ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories >> Software >> Programming-Languages >> C
 
 


 

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.
 
0
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);
 
0
Barun
 
 
Answer
unsigned int count=0,no;
/* 
Enter no Here................
*/
while(no ! =0)
{
  if((no & 0x01) ==1)
     count++;
  no=no >>1
}
printf("%d",count);
 
0
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
 
0
Guhan
 
 
Answer
Count with your fingers: 1 boob, 2 boob, etc.
 
0
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
 
0
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
  
****************************************************************************/
}
 
0
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;
 
1
Rani
 
 
Answer
char * const p;  ->it is const pointer to char
  const char * p;  ->it is pointer to const char
 
1
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
 
1
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.
 
0
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.........
 
0
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();
}
 
5
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.
 
0
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;
}
 
0
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
 
0
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.
 
0
Arunprasath
 
 
Answer
c is a structure oriented programming language
 
0
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..
 
0
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.
 
0
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.
 
0
Mani
 
 
Answer
if they want any vacancy i will try it
 
0
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....
 
0
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..
 
0
Shruti
 
 
Answer
for written exam...prepare  GRE Barrons 12 
edition...n.....for tech interviwe...b confident for every 
answer
 
0
Sukekshani
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com