// ConsoleStructSimpleApp.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include <fstream>//文件操作 #include <sstream>//int转string #include <iomanip>//cout格式化输出 setw() #include <stdlib.h> #include "GeovinDu.h" using namespace std; using namespace DuStructSimple; //#pragma pack(2) /// <summary> /// /// </summary> enum weekdayname { /// <summary> /// /// </summary> SUN=1, /// <summary> /// /// </summary> MON=2, /// <summary> /// /// </summary> TUE=3, /// <summary> /// /// </summary> WED=4, /// <summary> /// /// </summary> THU=5, /// <summary> /// /// </summary> FRI=6, /// <summary> /// /// </summary> SAT=7 }; /// <summary> /// /// </summary> enum color { red = 5, blue, green }; union person { int age; char name[256]; char sex[2]; }; union person2 { int age; char name; char sex; }du; void func(int** pp) { *pp= new int(3); //*pp = 40; cout << "pp=" << pp << ",*pp=" << *pp <<",**pp=" << **pp<< endl; } void func2(int* pp) { *pp = 3; cout << "pp2=" << pp << ",*pp2=" << *pp << endl; } int main() { int* dup=0; func(&dup); cout << "p==" << dup << ",*p==" << *dup << endl; //2 cout << "**************2*************" << endl; int dup2 = 1; func2(&dup2); cout << "p2==" << dup << ",&p2==" << &dup << endl; int a = 10; cout << "&a=" << &a << endl; int* p = &a; cout << "p=" << p <<",&p="<<&p<<",*p="<<*p << endl; int** j = &p; cout << "j=" << j << ",&j=" << &j << endl; cout << "*j=" << *j << endl; cout<<",**j="<<**j<< endl; //person per; //per.age = 30; ////per.name = "g"; ////per.sex = "m"; //cout << "person内存:" << sizeof(person) << endl; //cout << "person2 内存:" << sizeof(person2) << endl; //cout << "person sex内存 " << sizeof(per.sex) << endl; //cout << "person2 sex内存 " << sizeof(du.sex) << endl; ////地址相同: //cout << "per.name=" << &per.name << endl; //cout << "per.age=" << &per.age << endl; //cout << "per=" << &per << endl; // std::cout << "Hello World!涂聚文 Geovin Du\n"; //int num; //cout << "输入5-7(红,蓝,绿):" << endl; //cin >> num; //switch (num) //{ //case 5: // cout << "红色" << endl; // break; //case 6: // cout << "蓝色" << endl; // break; //case 7: // cout << "绿色" << endl; // break; //default: // cout << "错误!" << endl; // break; //} //cout << "枚举类型:" << endl; //cout << SUN <<","<<MON<<","<<TUE<<"," << WED <<","<<THU<<","<<FRI<<","<<SAT<< endl; //enum weekdayname day; //day = FRI; //cout << day << endl; //GeovinDu geovin; // //geovin.DisplayStructSize(); //geovin.displayStudent(); // 无用 //geovin.dispalyStructDemo(); // // //geovin.dsipalyFuntion(); //geovin.dipslayStructCustomer(); system("pause"); return 0; } // 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 // 调试程序: F5 或调试 >“开始调试”菜单 // 入门使用技巧: // 1. 使用解决方案资源管理器窗口添加/管理文件 // 2. 使用团队资源管理器窗口连接到源代码管理 // 3. 使用输出窗口查看生成输出和其他消息 // 4. 使用错误列表窗口查看错误 // 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 // 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件
标签:文件,pp,cout,point,int,char,cpp,include From: https://www.cnblogs.com/geovindu/p/17399313.html