main()
{
char a[4]="HELLO";
printf("%s",a);
}
Answers were Sorted based on User's Feedback
Answer / dani
Actually I compiled this and ran it unix and it just prints out a warning, not an error:
"warning: initializer-string for array of chars is too long"
The programme prints the initial array without the last character (because of the '\0' special character):
"HELL �"
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / susie
Answer :
Compiler error: Too many initializers
Explanation:
The array a is of size 4 but the string constant requires 6
bytes to get stored.
| Is This Answer Correct ? | 2 Yes | 2 No |
what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }
Write a program that reads a dynamic array of 40 integers and displays only even integers
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
Who could write how to find a prime number in dynamic array?
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
main() { 41printf("%p",main); }8
Write a routine to implement the polymarker function
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }