Can you combine the following two statements into one?
   char *p; 
p

Home | Discussion Forum
Taiyari24Hour

Can you combine the following two statements into one?

   char *p; 
p = (char*) malloc(100);



View More Related Question

1) What will be the output of the following C code?

 #include <stdio.h>
int main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
return 0;
}

2) What will be the output of the program ?

 #include<stdio.h>
int main()
{
char str[20] = "Hello";
char *const p=str;
*p='M';
printf("%s\n", str);
return 0;
}

3) What will be the output of the following C code?

 #include <stdio.h>
int x = 0;
void main()
{
int *ptr = &x;
printf("%p\n", ptr);
x++;
printf("%p\n ", ptr);
}

4) Comment on the following C statement.

  const int *ptr;

5) What will be the output of the program ?

 #include<stdio.h>
int main()
{
static char *s[] = {"black", "white", "pink", "violet"};
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf("%s", **p+1);
return 0;
}

UP Gk Online Test

taiyari24hour.com

Study 2 Online Says....
Kindly log in or signup.