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 string that is a formal parameter can be declared
Q. What is the output of C Program with functions and pointers.?
Q. Select the odd one out with respect to type?
Q. Which of the following format specifiers is used to represent the name of the time zone?
Q. Which of the following are tokens in C?
Q. Choose a correct statement about Right Shift Operator >> ?
Q. The size of the following union, where an int occupies 4 bytes of memory is
Discusssion
Login to discuss.