What will be the output of the following C++ code? [code] #include <iostream> #include <string.h> using namespace std;

Nguyễn Tân

New member
What will be the output of the following C++ code?
Code:
    #include <iostream>
    #include <string.h>
    using namespace std;
    int main()
    {
        struct student 
        {
            int num;
            char name[25];
        };
        student stu;
        stu.num = 123;
        strcpy(stu.name, "John");
        cout << stu.num << endl;
        cout << stu.name << endl;
        return 0;
    }
A.
123
john
B.
john
john
C. compile time error
D. runtime error
 

Tìm kiếm

Back
Top