COSMOSRKSI
방명록 RSS 태그 글쓰기 관리자
 
[vscode] cygwin으로 설치한 gdb로 c++ 디버깅 안될 때 해결방법
Program language/C++ 2023-07-24 18:20:37

gdb 버전을 9.2.1로 다운그레이드 하면 해결됨

 


[C++] 구조체와 포인터
Program language/C++ 2021-04-22 20:16:40

#include <iostream>
#include <string>
#include <cstring>
using namespace std;

typedef struct _student {
char name[20];
int age;
}student;

void main()
{
student std1;
student* pstd1 = &std1;
cin >> pstd1->age;
cin >> pstd1->name;
cout << pstd1->age;
cout << pstd1->name;
}

 

-------------------------------

 

#include <iostream>
#include <string>
#include <cstring>
using namespace std;

struct student {
char name[20];
int age;
};

void main()
{
struct student std1;
struct student* pstd1 = &std1;

cin >> pstd1->name;
cin >> pstd1->age;

cout << pstd1->name;
cout << pstd1->age;
}



[C++] 네임스페이스 연습 코드 (using namespace, x::y)
Program language/C++ 2021-03-28 12:54:11

#include <iostream>
#include <string>

using namespace std;

namespace worker {
char name[20] = { '0' };
int overtime = 0;

void Show(char name[], int overtime)
{
cout << "name: \t" << name << "\novertime: \t" << overtime << endl;
}
}

namespace student {
char name[20] = { '0' };
float score = 0;

void Show(char name[], int score)
{
cout << "name: \t" << name << "\nscore: \t" << score << endl;
}
}

void main()
{
using namespace student;

strcpy_s(name, 20, "abc");
score = 99.9;
Show(name, score);

cout << endl << endl;

strcpy_s(worker::name, 20, "efg");
worker::overtime = 90;
worker::Show(worker::name, worker::overtime);

}

 



이 사이트에는
넥슨코리아에서 제공한 넥슨 Lv.1 고딕 Regular체,
카페24가 제작한 아네모네체,
Cadson Demak가 디자인한 Kanit체,
Sandoll이 디자인한 나눔고딕체가
적용되어 있습니다.
멋진 폰트를 무료로 제공해주셔서 감사합니다.

Copyleft ⓒ bskyvision (블루스킨 v1.2)