string storing in integer array!

Aug 18, 2012 at 6:13pm
what is the output?

int i1[]={"\12345s\n"};
printf("i1=%d\n",sizeof(i1));



Aug 18, 2012 at 6:15pm
The output is a compiler error. It doesn't make sense to store a string in an array of ints. What are you trying to accomplish?
Aug 20, 2012 at 5:22pm
iam trying to solve a question..
the question is find the output of the printf statement!!!
Aug 21, 2012 at 1:49am
if I correct the code of yours
1
2
int i1[]={12345};
printf("i1=%d\n",sizeof(i1));


the output if i1=4

since you can't do {"\12345s\n"} in a integer array
Last edited on Aug 21, 2012 at 1:50am
Aug 21, 2012 at 5:45am
Silly question: did you ever try to compile it to find the answer? Yes, l know its stupid and compleaty ridiculous, but did it ever occur to you?
Topic archived. No new replies allowed.