What will output of the following C++ code?
# include <iostream> # include <string.h> using namespace std; struct Test { char str[20]; }; int main() { struct Test st1, st2; strcpy(st1.str, "GeeksQuiz"); st2 = st1; st1.str[0] = 'S'; cout << st2.str; return 0; }
Segmentation Fault
geeksquiz
GeeksQuiz
Compiler Error
This question is part of this quiz :
C++ Structure and Union