-
How do you redirect a standard stream?
Most operating systems, including DOS, provide a means to redirect program input and output to and from different devices. This means that rather than your program output (stdout) going to the screen; it can be redirected to a file or printer port. Similarly, your program’s input (stdin) can come from a file rather than the keyboard. In DOS, this task is accomplished using the redirection characters,...
-
Are pointers integers?
No, pointers are not integers.A pointer is an address.It is merely a positive number and not an integer.
-
-
What is the output of the following sample C Code
Int *ptr = (int *)malloc(100*(sizeof(int)));ptr++;free(ptr);
-
-
-
-
-
-
-
-
printf(" %d", sizeof(u.a));
// printf("%d", sizeof(u.a[4].i));
}
">Union u{ union u { int i; int j; }a[10]; int b[10];}u;main(){ printf("n%d", sizeof(u)); printf(" %d", sizeof(u.a));// printf("%d", sizeof(u.a[4].i));}
A) None of the AboveB) 1, 100, 1C) 40, 4, 4D) 4, 4, 4Explanation: 20, 200, error for 3rd printf
-
-
-
-
-
}
plz simplify the statement the 2 .when i run program gives undefined symbol p..but in a/c mcq that is correct ..say collect address of i ..how?? ">1)what is RTTI in c++?2)main(){ int i=10; int &p=i; //statement 2printf("%d %d"i,p);}plz simplify the statement the 2 .when i run program gives undefined symbol p..but in a/c mcq that is correct ..say collect address of i ..how??
-
Decrement operator in C
int a=3,y;
y=++a + a+++ --a+ ++a;
printf("%d%d",y,a);
Why value of y become 16. -
Removing duplicate words from a string
cint main()
{
char arr[1000];
char *temp=NULL;
char *temp1=malloc(100);
int len;
printf("enter the string:
");
gets(arr);
len=strlen(arr);
puts(arr);
printf("len:%d
",len);
temp=strtok(arr," ");
if(temp!=NULL)
strcpy(temp1,temp);
while(temp!=NULL)
{
temp=strtok(NULL,"... -
C Interview Questions
Ans