gdb 버전을 9.2.1로 다운그레이드 하면 해결됨
'Program language > C++' 카테고리의 다른 글
[C++] 구조체와 포인터 (0) | 2021.04.22 |
---|---|
[C++] 네임스페이스 연습 코드 (using namespace, x::y) (0) | 2021.03.28 |
gdb 버전을 9.2.1로 다운그레이드 하면 해결됨
[C++] 구조체와 포인터 (0) | 2021.04.22 |
---|---|
[C++] 네임스페이스 연습 코드 (using namespace, x::y) (0) | 2021.03.28 |
#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;
}
[vscode] cygwin으로 설치한 gdb로 c++ 디버깅 안될 때 해결방법 (0) | 2023.07.24 |
---|---|
[C++] 네임스페이스 연습 코드 (using namespace, x::y) (0) | 2021.03.28 |
#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);
}
[vscode] cygwin으로 설치한 gdb로 c++ 디버깅 안될 때 해결방법 (0) | 2023.07.24 |
---|---|
[C++] 구조체와 포인터 (0) | 2021.04.22 |