| Back to Questions Page |
| |
| Question |
wats SIZE_T meant for? |
Rank |
Answer Posted By |
|
Question Submitted By :: Uttejana |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | int
But this size is compiler dependent depending on the
processor you are using. I mean on 32 bit or 64 machines.  |
| Barun |
| |
| |
| Question |
how do u find out the number of 1's in the binary
representation of a decimal number without converting it
into binary(i mean without dividing by 2 and finding out
the remainder)? three lines of c code s there it
seems...can anyone help |
Rank |
Answer Posted By |
|
Question Submitted By :: Uttejana |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | int x =0x1;
static count;
while(no ! =0)
{
if((no >>1 & x) ==1)
count+=1;
}
printf("%d",count);  |
| Barun |
| |
| |
| Answer | unsigned int count=0,no;
/*
Enter no Here................
*/
while(no ! =0)
{
if((no & 0x01) ==1)
count++;
no=no >>1
}
printf("%d",count);  |
| Ravi Saini |
| |
| |
|
|
| |
| Question |
How to calculate Total working time using Login and
logout? |
Rank |
Answer Posted By |
|
Question Submitted By :: Rcnimmagadda |
| This Interview Question Asked @ Wipro , Signal Networks, Tcs |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | take a difference between logout and login time  |
| Guhan |
| |
| |
| Answer | Count with your fingers: 1 boob, 2 boob, etc.  |
| Ahmed Park [Amstech Solutions] |
| |
| |
| Question |
dibakar & vekatesh..uttejana here..abt ur reply for in
place reversal of linked list..wats p stands for there? |
Rank |
Answer Posted By |
|
Question Submitted By :: Uttejana |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | p stands for head node.
link stands for the next node it has to point  |
| Vinod L R |
| |
| |
| Question |
Explain in detail how strset (string handling function
works )pls explain it with an example. |
Rank |
Answer Posted By |
|
Question Submitted By :: Kailasam |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | strnset - strset - Set Bytes in String
Syntax
#include <string.h>
char *strnset(char *string, int c, size_t n);
char *strset(char *string, int c);
Example:
#include <stdio.h>
#include <string.h>
int main(void)
{
char *str = "abcdefghi";
printf("This is the string: %s\n", str);
printf("This is the string after strnset: %s\n",
strnset(str, 'x', 4));
printf("This is the string after strset: %s\n",
strset(str, 'k'));
return 0;
/****************************************************************************
The output should be:
This is the string: abcdefghi
This is the string after strnset: xxxxefghi
This is the string after strset: kkkkkkkkk
****************************************************************************/
}  |
| Lakshman |
| |
| |
| Question |
wats the diference btwen constant pointer and pointer to a
constant.pls give examples. |
Rank |
Answer Posted By |
|
Question Submitted By :: Uttejana |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Constant pointer cannot be reassigned to different objects
once its initialized. It can be used to modify the object
that it points to.
Eg.
int *const constPtr;
*constPtr =0; //can be modified like this
Pointer to constant can be reassigned to point to another
object of same type.
int const *ptrConst;
ptrConst = 0;  |
| Rani |
| |
| |
| Answer | char * const p; ->it is const pointer to char
const char * p; ->it is pointer to const char  |
| Satish |
| |
| |
| Answer | Pointer is a variable containing the addres of another
variable;
Constant pointer is a variable which points to a variable
constantly.it means that , once it is initialised,it cannot
be changed.Till the end of program,it points to that
variable only;
EXAMPLE:
char k,m;
const char *p=&k;
p=&m;//(syntax error)
********
A pointer to a constant is a pointer such that the contents
of the variable(pointed by the pointer)cannot be modified
throuhg the pointer;
EXAMPLE:
char m='l';
char * const p;
p=&m;
*p='u';//syntax error
m='k';//no syntax error  |
| Rudra Prasad Panda |
| |
| |
| Answer | Pointer to a consttant ::: such that the value to which
pointer points can't be changed
const int *ptr1=7
*ptr=8 // invalid
constant pointer :::: pointer direction can't be cheged .
int *const x =6;
x=7 or x=&i // invalid
Location of pointer can't be chenged.  |
| Sanjay |
| |
| |
| Answer | CONSTANT POINTER: A pointer will always point to one
object.it is initialized at the time of declaration.
e.g
int i=20,j;
int* const p=&i;
cout<<*p; //will print 20
*p=30;//works....i.e the value pointed by the constant
pointer can be changed
//now if write
p=&j;//error
POINTER TO CONSTANT
it can be declared as
const int *p;
or
int const *p;
int i=10,j=30;
p=&i;
cout<<*p;
*p=10//error...the value is constant pointed by p
//pointer p is not constant so it can now point to another
variable of integer type
//so if we write
p=&j //it will now point to a variable j
that's all.........  |
| Monika Sethi |
| |
| |
| Answer | //POINTER TO CONSTANT vs CONSTANT POINTER
#include<iostream.h>
#include<conio.h>
//POINTER TO CONSTANT
void f1()
{
int i=10,j=20;
const int* pi=&i;
cout<<*pi<<endl;
//*pi = 200; ERROR : CANNOT MODIFY A CONST OBJECT IN f1()
pi=&j; // IT CAN POINT ANOTHER CONSTANT
cout<<*pi<<endl;
}
//CONSTANT POINTER
void f2()
{
int i=100,j;
int* const pi=&i;
cout<<*pi<<endl;
*pi = 200; // IT CAN ASSIGN ANOTHER VALUE AT THIS ADDRESS
cout<<*pi<<endl;
//pi=&j; ERROR : CANNOT MODIFY A CONST OBJECT IN f2()
}
void main()
{
clrscr();
f1();
f2();
getch();
}  |
| Surya Mukherjee |
| |
| |
| Question |
how to do in place reversal of a linked list(singly or
doubly)? |
Rank |
Answer Posted By |
|
Question Submitted By :: Uttejana |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | int reverse()
{
node *r,*s,*q;
s=NULL;
q=p;
while(q!=NULL)
{
r=q;
q=q->link;
r->link=s;
s=r;
}
p=r;
return;
}
this is reverse fun for single linked list.  |
| Divakar & Venkatesh |
| |
| |
| Answer | rev()
{
struct node *a1,*a2,*a3;
if(start->next==NULL) /*Only one element exists*/
return;
a1=start;
a2=a1->next;
a3=a2->next;
a1->next=NULL;
a2->next=a1;
while(a3!=NULL)
{
a1=a2;
a2=a3;
a3=a3->next;
a2->next=a1;
}
start=a2;
}  |
| Ashish Gupta |
| |
| |
| Question |
what's the o/p
int main(int n, char *argv[])
{
char *s= *++argv;
puts(s);
exit(0);
}
|
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
| This Interview Question Asked @ Motorola |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | first command line argument
lets say..
exe for above prog is a.out
execute command
a.out arg1 arg2 arg3
then out put will be arg1  |
| Sreed |
| |
| |
| Question |
what is meant by c |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | c is a structured oriented programming.developed by dennis
ritche in 1970.in c ,we are having only objects.There is no
security and reusuability.  |
| Arunprasath |
| |
| |
| Answer | c is a structure oriented programming language  |
| Anitha |
| |
| |
| Answer | C in particular does not mean anything..
A language named "B" was invented by ken Thompsan,
but there were a few problem.
Dennis Ritchie wrote a new programing language which
overcame all the flaws in "B"..
That language was "C"..
I think becoz it came after "B", he named it C..
we can also expect D - Z..;-) jokes apart..
but no more prog languages yaar.. :-(
we have enuf of them..  |
| Shruti |
| |
| |
| Answer | c is a programmic lunge whais was introduced tothe world in
1972 by dennies reche. its plays a majour role in comptr
programming.and also it is basic 4 all other language.  |
| K Pavan |
| |
| |
| Question |
i want to job in your company, so how it will be possible. |
Rank |
Answer Posted By |
|
Question Submitted By :: Praphulla Raghav Shukla. |
| This Interview Question Asked @ TCS |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | if there is a vacancy in that company.  |
| Mani |
| |
| |
| Answer | if they want any vacancy i will try it  |
| Sundar |
| |
| |
| Question |
please give me some tips for the selection in TCS. |
Rank |
Answer Posted By |
|
Question Submitted By :: Praphulla Raghav Shukla. |
| This Interview Question Asked @ TCS |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Be cofident.... perfect with ur basics they don't ask u
deeply in tech round.... All the best....  |
| Vassu |
| |
| |
| Answer | before getting into technical round you have to clear ur
apptitude round..
they have an online test..
they ask GRE ques..
prepare properly..  |
| Shruti |
| |
| |
| Answer | for written exam...prepare GRE Barrons 12
edition...n.....for tech interviwe...b confident for every
answer  |
| Sukekshani |
| |
| |
|
| |
|
Back to Questions Page |