C
Q. What will be the output of the following C code?
#include <stdio.h> int main() { char str1[] = "Hello"; char str2[10]; str2 = str1; printf("%s,%s", str1, str2); return 0; }
There will be a compilation error, because we cannot assign a string like this (str2 = str1). To resolve this issue, we have to use strcpy(str2,str1). The output will be: main.c:8:10: error: assignment to expression with array type 8 | str2 = str1; | ^
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. A full binary tree with n leaves contains
Q. As soon as a pointer variable is freed, its value
Q. The statement printf("%c", 100); will print?
Q. C language was invented in the year?
Q. An identifier's storage class determines
Q. Which of the following function is used for sets the position to a desired point in the file
Q. What is the extension of output file produced by Preprocessor?
Discusssion
Login to discuss.