C++????????????????
?????tangzhilinhk ???????[ 2016/10/26 10:16:39 ] ????????C++ ????
???????????????????
??????????C++?л???????????????????????????ó????к?????????????????á??????????????????????????????????????????????????????
????1????????
??????UE??????????μ?????????????chapter0802.cpp???????????????makefile?????????FTP?????????Linux?????????????????scrt?????????????????????????????????
????/**
????* ???chapter0802
????* ????chapter0802.cpp
????* ????????????????
????*/
????#include <iostream>
????using namespace std;
????struct bookInfo //?????鱾????bookInfo??????鱾???????
????{
????int id; //??????????????????????id????鱾???
????char bookname[50]; //???????????????????50?????????????????????
????char author[50]; //???????????????????50???????????????????????
????char publisher[50]; //???????????????????50?????????????????????????
????};
????/*
????* ?????????????????????????
????* ????????????????????????
????* ?????????
????*/
????void dealValueParam(bookInfo book);
????/*
????* ???????????????????????????
????* ????????????????????ò???
????* ?????????
????*/
????void dealQuoteParam(bookInfo &book);
????/*
????* ??????????????????????????
????* ???????????????????????
????* ?????????
????*/
????void dealPointerParam(bookInfo *book);
????/*
????* ????????????????????????
????* ????????????????????????
????* ?????????
????*/
????void dealStructArrary(bookInfo *book);
????/*?????????*/
????int main()
????{
????bookInfo book1 ={1??"Linux"??"jack"??"Oxford University Press"}; //??????????book1???????
????bookInfo book2 = book1; //??????????book2????????book1?????????????
????bookInfo *book3 = &book2; //?????????????????????book2?????????????
????bookInfo book4[2] ={{10??"C++"??"john"??"Oxford University Press"}??
????{11??"java"??"lining"??"Oxford UniversityPress"}}; //??????????????????????
????dealValueParam(book1); //???y?????????????????
????cout<<"After dealValueParam =>book1 id:"<<book1.id<<endl; //???????????????????仯
????dealQuoteParam(book2); //???y???????????????????
????cout<<"After dealQuoteParam =>book2 id:"<<book2.id<<endl; //???????????????????任
????dealPointerParam(book3); //???y?????????????????
????cout<<"After dealPointerParam =>book2id:"<<book2.id<<"or"<<book3->id<<endl;
????dealStructArrary(book4); //???y??????鴫????????
????return 0;
????}
????/*??????????????????????????*/
????void dealValueParam(bookInfo book)
????{
????book.id = 2; //?????????????г???
????cout<<"The bookinfo:"<<endl; //????????????????????
????cout<<"bookid:"<<book.id<<" "<<"bookname:"<<book.bookname<<endl;
????cout<<"bookauthor:"<<book.author<<" "<<"bookpublisher:"<<book.publisher<<endl;
????}
????/*????????????????????????????*/
????void dealQuoteParam(bookInfo &book)
????{
????book.id = 3; //?????????????г???
????cout<<"The bookinfo:"<<endl; //????????????????????
????cout<<"bookid:"<<book.id<<" "<<"bookname:"<<book.bookname<<endl;
????cout<<"bookauthor:"<<book.author<<" "<<"bookpublisher:"<<book.publisher<<endl;
????}
????/*??????????????????????????*/
????void dealPointerParam(bookInfo *book)
????{
????book->id = 4; //?????????????г???
????cout<<"The bookinfo:"<<endl; //????????????????????
????cout<<"bookid:"<<book->id<<" "<<"bookname:"<<book->bookname<<endl;
????cout<<"bookauthor:"<<book->author<<" "<<"bookpublisher:"<<book->publisher<<endl;
????}
????/*?????????????????????????*/
????void dealStructArrary(bookInfo *book)
????{
????cout<<"The book struct arrayinfo:"<<endl; //????????????????????
????for(int i = 0;i < 2;i++)
????{
????cout<<"bookid:"<<book[i].id<<" "<<"bookname:"<<book[i].bookname<<endl;
????cout<<"book author:"<<book[i].author<<""<<"book publisher:"<<book[i].publisher<<endl;
????}
????}
??????????????????????巽??????????????????á????????????????????????????????????????????????????????????????????????????????????????????????????????ɡ???????????????????????????
????2????makefile
????Linux????????????????chapter0802.cpp?????makefile?????????????????????????
????OBJECTS=chapter0802.o
????CC=g++
????chapter0802: $(OBJECTS)
????$(CC)$(OBJECTS) -g -o chapter0802
????clean:
????rm -fchapter0802 core $(OBJECTS)
????submit:
????cp -f -rchapter0802 ../bin
????cp -f -r*.h ../include
????????makefile??????????????????????滻??????????????????м??????????г????????????????-g??????????????????????????????????
????3?????????г???
???????shell?????make???????????г??????????????make submit????????????????????bin???????cd????λ?????bin??????иó?????????н???????????
????[ocs@vm-rh:~/users/wangfeng/Linux_c++/chapter08/chapter0802/src]$make
????g++ -c -ochapter0802.o chapter0802.cpp
????g++ chapter0802.o -g -o chapter0802
????[ocs@vm-rh:~/users/wangfeng/Linux_c++/chapter08/chapter0802/src]$makesubmit
????cp -f -r chapter0802 ../bin
????cp -f -r *.h ../include
????[ocs@vm-rh:~/users/wangfeng/Linux_c++/chapter08/chapter0802/src]$cd../bin
????[ocs@vm-rh:~/users/wangfeng/Linux_c++/chapter08/chapter0802/bin]$./chapter0802
????The book info:
????book id:2 book name:Linux
????book author:jack book publisher:Oxford UniversityPress
????After dealValueParam => book1 id:1
????The book info:
????book id:3 book name:Linux
????book author:jack book publisher:Oxford UniversityPress
????After dealQuoteParam => book2 id:3
????The book info:
????book id:4 book name:Linux
????book author:jack book publisher:Oxford UniversityPress
????After dealPointerParam => book2 id:4or4
????The book struct array info:
????book id:10 book name:C++
????book author:john book publisher:Oxford UniversityPress
????book id:11 book name:java
????book author:lining book publisher:Oxford UniversityPress
???????????????????????????????????????????????????????????????????????????????????????????C++?л??????????????????????????????????????????????????ó?????????????鱾???????bookInfo???????????4??????????????????????????????????????????????????????????????????????
?????????????????????2??bookInfo?????????????н??????book1?????????????????book2?????????book1????????????????????岻????????????????????????????????????????book3????????book2???????丳??????????book3???????????book2??????book4?????????????????????飬??????????????????
??????????4??????????????????????????????????????????????????????????????????????????????????????????????????y?????????????ú??????ú????????????id????????????????????????????????????????????ββ?????????β????????????????????Ρ?
?????????????????????????????ò??????????????????????????????????????????????????????????????????ε?????????????????βε?????????????Ρ?
?????????????????????????д???????????????????????????????????????????????y??????????????????????????????????????????????????????????????顣
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????