char *someFun()
{
char *temp = “string constant";
return temp;
}
int main()
{
puts(someFun());
}
Answer / susie
Answer :
string constant
Explanation:
The program suffers no problem and gives the output
correctly because the character constants are stored in
code/data area and not allocated in stack, so this doesn’t
lead to dangling pointers.
| Is This Answer Correct ? | 4 Yes | 0 No |
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
void main() { int i=5; printf("%d",i++ + ++i); }
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }
#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?
main() { char a[4]="HELLO"; printf("%s",a); }
main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
How to palindrom string in c language?
write a c-program to display the time using FOR loop
main() { char not; not=!2; printf("%d",not); }