05-13 07:28
Notice
Recent Posts
Recent Comments
관리 메뉴

Scientific Computing & Data Science

[C/C++] Example / Structure 본문

Programming/C&C++

[C/C++] Example / Structure

cinema4dr12 2014. 6. 12. 10:25

//
//  main.cpp
//

#include <iostream>
#include <string>

using namespace std;

struct Student {
    int n;
    string name;
    int eng;
    int math;
};

int main( int argc , const char * argv [])
{
    Student choi;
    choi.n = 15;
    choi.name = "geol";
    choi.eng = 100;
    choi.math = 99;
   
    cout << choi.n << endl;
    cout << choi.name << endl;
    cout << choi.eng << endl;
    cout << choi.math << endl;
   
    return 0 ;
}

'Programming > C&C++' 카테고리의 다른 글

[C/C++] Example / Class  (0) 2014.06.12
[C/C++] Example / Pointer of Structure  (0) 2014.06.12
[C/C++] Example / Dynamic Array  (0) 2014.06.12
[C/C++] Example / swap: call by pointer  (0) 2014.06.12
[C/C++] Example / swap: call by reference  (0) 2014.06.12
Comments