struct Foo
{
char *pName;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}
a. Your Name
b. compile error
c. Name
d. Runtime error
Answers were Sorted based on User's Feedback
Who could write how to find a prime number in dynamic array?
Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).
How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
main() { int i=5,j=6,z; printf("%d",i+++j); }
main() { int a[10]; printf("%d",*a+1-*a+3); }
Which version do you prefer of the following two, 1) printf(“%s”,str); // or the more curt one 2) printf(str);
Find your day from your DOB?
15 Answers Accenture, Microsoft,
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
find A^B using Recursive function