Lại là copy code đây mà. Thông báo trên không phải là lỗi, bạn làm 1 trong 2 cách sau:
1. Thêm lệnh system("pause"); vào trước lệnh return 0;
2. Nhấn Ctrl + F5
Mình làm trên VS c++ 2010 exp, nhưng ko hiểu sao lại ko chạy được code về cấu trúc dữ liệu
VD như code này :
#include <iostream.h>
#include <stdlib.h>
using namespace std;
typedef struct {
int day;
int month;
int year;
} Date;
typedef struct {
char name[20];
Date birthDay;
char role[20];
float salary;
} Employee;
void Display(Employee myEmployee);
void Display(Employee myEmployee){
cout << "Name: " << myEmployee.name << endl;
cout << "Birth day: " << myEmployee.birthDay.day << "/"
<< myEmployee.birthDay.month << "/"
<< myEmployee.birthDay.year << endl;
cout << "Role: " << myEmployee.role << endl;
cout << "Salary: " << myEmployee.salary << endl;
return;
}
void main(){
clrscr();
Employee myEmployee =
{“Nguyen Van A”, {15, 5, 1980}, "Nhan vien", 300f};
cout << "Thong tin mac dinh:" << endl;
Display(myEmployee);
cout << "Name: ";
cin >> myEmployee.name;
cout << "Day of birth: ";
cin >> myEmployee.birthDay.day;
cout << "Month of birth: ";
cin >> myEmployee.birthDay.month;
cout << "Year of birth: ";
cin >> myEmployee.birthDay.year;
cout << "Role: ";
cin >> myEmployee.role;
cout << "Salary:";
cin >> myEmployee.salary;
cout << "Thong tin sau khi doi:" << endl;
Display(myEmployee);
return;
}
Lỗi của nó:
'thanh.exe': Loaded 'C:\Users\Thuy\Documents\Visual Studio 2010\Projects\thanh\Debug\thanh.exe', Symbols loaded.
'thanh.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'thanh.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'thanh.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
'thanh.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'thanh.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
The program '[2164] thanh.exe: Native' has exited with code 0 (0x0).
Code nào về cấu trúc cũng ghi có đúng lỗi đó ko khác tý gì!
Đã được chỉnh sửa lần cuối bởi chipga2006 : 16-08-2011 lúc 03:01 PM.
Lại là copy code đây mà. Thông báo trên không phải là lỗi, bạn làm 1 trong 2 cách sau:
1. Thêm lệnh system("pause"); vào trước lệnh return 0;
2. Nhấn Ctrl + F5
Một người nào đó coi thường ý thức kỷ luật cũng có nghĩa là người đó đã coi thường tương lai số phận của chính bản thân người đó. Những người coi thường ý thức kỷ luật sẽ không bao giờ có được sự thành công trong sự nghiệp!Email: admin[@]congdongcviet.com | CC to: info[@]congdongcviet.com
Phone: 0972 89 7667 (Office: 04 6329 2380)
Yahoo & Skype: dreaminess_world (Vui lòng chỉ rõ mục đích ngay khi liên hệ, cảm ơn!)
Ua đúng ùi ha tại tui làm biếng copy code trong word lúc tui làm ở trường bỏ vào hèn chi chạy ko được..Hj! Thank nhé!