[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-572021-105":53,"doc-detail-572021-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","cc-cheat-sheet-reference-and-exam-included","C/C++ Cheat Sheet - Reference and Exam Included","","C/C++ Cheat Sheet compiles core language reference points for quick study, including a sample C++ program that demonstrates classes, constructors, virtual methods, inheritance, and dynamic dispatch. It also summarizes common printf and scanf format specifiers for integers, floats/doubles, strings, and chars. Additional string.h string operations are listed (strcpy, strlen, strcmp, strcat), followed by notes on abstract classes and the use of pure virtual methods (virtual ... = 0).",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/cc-cheat-sheet-reference-and-exam-included/572021/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/cc-cheat-sheet-reference-and-exam-included/572021.png","ImageObject",442,249,{"name":88,"@type":89},"Alex Sinclair","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-19","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":47},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"What does the sample C++ program demonstrate?","Question",{"text":108,"@type":109},"It illustrates classes, constructors, private/protected members, virtual functions, inheritance (Employee to Salesperson), and a main function that uses pointers and calls virtual methods polymorphically.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"Which printf/scanf format specifiers are listed?",{"text":113,"@type":109},"The sheet lists %d for integers, %f for float/double in printf, %s for strings (char arrays), and %c for a single char. For scanf it includes %d for integers and %f for float, plus %lf for double.",{"name":115,"@type":106,"acceptedAnswer":116},"How are string operations and abstract methods handled?",{"text":117,"@type":109},"It references including \u003Cstring.h> and lists strcpy, strlen, strcmp, and strcat. For abstract classes, it explains that pure virtual methods use the form virtual void sound(char s[]) = 0; without using the abstract keyword.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},572021,1792267092,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":47,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":9},1099523882182,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","C/C++ Cheat Sheet  \nForyour reference; this sheet will also be included in exams  \nCISC 124, fall 2004  \nSample C++ Program:  \n\\#include \u003Cstdio.h>  \n\\#include \u003Cstring.h>  \nclass Employee { private:  \nchar name[51];  \ndouble wage; // hourly wage protected:  \ndouble payOwed; public:  \nEmployee(char n[], double w) { strcpy(name, n);  \nsetWage(w);  \npayOwed = 0;} // end constructor  \nvirtual void pay(double hours) { payOwed += wage * hours;  \n} // end pay  \ndouble amountToPay() {  \nreturn payOwed;} // end amountToPay  \nvoid setWage(double wage) { this->wage = wage;  \n}  \nvoid zero() {  \npayOwed = 0;} // end zero  \n// prints employee  \nvirtual void print() { printf(\"name = %s, \", name);  \nprintf(\"wage = $% .2f, \", wage); printf(\"payOwed = $% .2f\",  \npayOwed);} // end print  \nvoid println() {  \nprint();  \nprintf(\"\\n\");} // end println  \n}; // end class Employee  \nclass Salesperson: public Employee { private:  \ndouble rate; public:  \nSalesperson(char name[],  \ndouble wage,  \ndouble rate): Employee(name, wage) {  \nthis->rate = rate;} // end constructor  \nvoid payForSale(double amount) { payOwed += amount * rate;  \n} // end payForSale  \nvoid print() {  \nprintf(\"Salesperson \");  \nEmployee::print();  \nprintf(\", rate: $% .2f\\n\", rate);} // end print  \n}; // end Salesperson  \nint main(void) {  \nEmployee mickey(\"Mickey Mouse\", 20); mickey.setWage(21);  \nmickey.println();  \nSalesperson *donald =  \nnew Salesperson(\"Donald Duck\", 10, 0 .15);  \ndonald->payForSale(100);  \ndonald->println();  \nEmployee *company[2];  \ncompany[0] = &mickey;  \ncompany[1] = donald;  \nfor (int i = 0; i \u003C 2; i++) { company[i] ->pay(10);  \ncompany[i] ->println();} // end for  \n} // end main  \nprintf formats:  \n%d: integer  \n%f: float or double %s: string (char array)  \n%c: char (single character)  \nscanf formats:  \n%d: integer %f: float  \n%lf: double (first character is L, not one!)%s: string (char array)  \n%c: char (single character)  \nstring methods:  \n/* to use these methods, you  \nmust include \u003Cstring.h> */ strcpy(char dest[], char src[])  \ncopies src in to destint strlen(char s[])  \nreturns length of sint strcmp(char s1[], char s2[])  \nreturns negative if s1 \u003C s2, 0 if s1 == s2 positive if s1 > s2  \nstrcat(char dest[], char src[]) adds src to the end of dest  \nabstract classes and methods:  \nvirtual void sound(char s[]) = 0;// Reminder: no \"abstract\" keyword .// Class headers do not indicate // whether the class is abstract or // not . A class is abstract if it // contains any abstract methods .","cbCaidoMeDwY6D0T","https://ap.wps.com/l/cbCaidoMeDwY6D0T","pdf",13561,"English","# C/C++ Cheat Sheet\n## Sample C++ Program Structure\n## printf and scanf Format Specifiers\n## string.h Methods\n## Abstract Classes and Pure Virtual Methods","[{\"question\":\"What does the sample C++ program demonstrate?\",\"answer\":\"It illustrates classes, constructors, private/protected members, virtual functions, inheritance (Employee to Salesperson), and a main function that uses pointers and calls virtual methods polymorphically.\"},{\"question\":\"Which printf/scanf format specifiers are listed?\",\"answer\":\"The sheet lists %d for integers, %f for float/double in printf, %s for strings (char arrays), and %c for a single char. For scanf it includes %d for integers and %f for float, plus %lf for double.\"},{\"question\":\"How are string operations and abstract methods handled?\",\"answer\":\"It references including \\u003cstring.h\\u003e and lists strcpy, strlen, strcmp, and strcat. For abstract classes, it explains that pure virtual methods use the form virtual void sound(char s[]) = 0; without using the abstract keyword.\"}]","C/C++ Cheat Sheet - Reference and Exam Included | PDF",1791925087]