[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-685675-105":59,"doc-detail-685675-en":130,"doc-similar-685675":149},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","c-summary-basic-commands-data-types-inputoutput-and-control-statements","C++ summary - basic commands, data types, input/output, and control statements","","Basic C++ command usage for compiling and running programs, showing how to use g++ with options such as output naming. Covers required headers for console input/output and file streams, plus core conventions like using semicolons and the role of carriage returns. Summarizes fundamental data types (integers, real numbers, characters/strings, booleans), arithmetic operations, standard math functions, comparison and logical operators, and key decision and loop structures. Includes examples of function definition and array declarations.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/c-summary-basic-commands-data-types-inputoutput-and-control-statements/685675/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/c-summary-basic-commands-data-types-inputoutput-and-control-statements/685675.png","ImageObject",300,407,{"name":92,"@type":93},"A glass of water","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-20","2026-11-07",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"How do you compile a C++ program using g++?","Question",{"text":112,"@type":113},"You can compile with g++ and specify the output executable and source file, for example using -o to choose the executable name. The summary also notes an example pattern like g++ -o executable filename.cc filename.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What headers are needed for screen I/O and file I/O in C++?",{"text":117,"@type":113},"For screen input/output, include #include \u003Ciostream> and use cout and cin. For file input/output, include #include \u003Cfstream>, then use ofstream for output and ifstream for reading.",{"name":119,"@type":110,"acceptedAnswer":120},"What are the common decision and loop statements in C++?",{"text":121,"@type":113},"Decision statements include if, else, else if, and switch with case labels and default. Repetition includes while, for (init; conditions; update), and do ... while, with conditions checked after executing the body in the do-while case.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},685675,1794016558,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":29,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":129,"read_time":143,"preview_page_count":8,"preview_urls":144},962090760832,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","Summary of basic C++-commands Compiling  \nTo compile a C++-program, you can use either g++ or c++ .  \ng++ -o executable 􀀌lename.out source􀀌lename.ccc++ -o executable 􀀌lename.out source􀀌lename.cce.g. g++ -o C++sample  inout . out C++sample  [inout. cc](inout. cc)  \nFor the following commands you can 􀀌nd at the end of this summary sample programs.  \nEach command in C++ is followed by “;”. Carriage return has no meaning in C++ .  \nComments  \nEssential for the writing of clear programs are comments, which are explanations for your program, and which are ignored by the compiler./* ... */ puts the text ... into comment (more than one line possible)  \n// ... puts text ... for rest of same line into comment Data Types  \n\n| Data Type | Declaration (Example) | Assignment (Example) |\n| --- | --- | --- |\n| integer | short i1, i2;\u003Cbr>int i1, i2;\u003Cbr>long i1, i2; unsigned i1, i2;\u003Cbr>unsigned long i1, i2; | i1 = 3; |\n| real | float f1,f2;\u003Cbr>double f1,f2;\u003Cbr>long double f1,f2; | f1 = 3 . 2; f2 = 2 . 1E-3; |\n| single character string of characters | char c1, c2; string s1, s2; | c1 = ’R’\u003Cbr>s1 = ”Farmer” |\n| logical | bool b1,b2; | b1 = true; b2 = false |\n\nInput And Output  \nInput/Output With Screen:  \nTo be able to use the following commands you need to write  \n\\#include \u003Ciostream> using namespace std;  \nat the beginning of your program:  \noutput: cout \u003C\u003C ”string of characters” ;  \ncout \u003C\u003C variable; \u003C\u003C endl; input: cin >> variable;  \nInput/Output With Files:  \nTo be able to use the following commands you need to write  \n\\#include \u003Cfstream> at the beginning of your program:  \noutput: ofstream out􀀌levariable (”output􀀌lename”, ios:: out); out􀀌levariable \u003C\u003C ... will write into 􀀌le with name output􀀌lename  \ninput: ifstream in􀀌levariable (”input􀀌lename”, ios:: in); in􀀌levariable >> ... will read from 􀀌le with name output􀀌lename  \nArithmetic Calculations Operations: + − ∗ / Functions:  \nTo be able to use all of the following functions you need to to write at the beginning of your program:  \n\\#include \u003Ccmath>  \n\\#include \u003Ccstdlib>  \npow(x,y) xy sin(x)  \ncos(x)  \ntan(x)  \nasin(x) sin−1(x) in range [−􀀙/2,􀀙/2] acos(x) cos−1(x) in range [0,􀀙] atan(x) tan−1(x) in range [−􀀙/2,􀀙/2] sinh(x)  \ncosh(x) tanh(x)  \nexp(x) ex log(x) ln (x) sqrt(x) √xfabs(x) |x|  \nfloor(x) largest integer not greater than x; example: floor(5 .768) = 5 ceil(x) smallest integer not less than x; example: ceil(5 .768) = 6 fmod(x,y) 􀀍oating-point remainder of x/y with the same sign as x  \nx % y remainder of x/y, both x and y are integers; example: 7%5=2  \nDecision Statements Comparison Operators:  \n== = example: i1 == i2  \n!=  i1 != i2  \n> > i1 > i2  \n\u003C \u003C i1 \u003C i2  \n>= ≥ i1 >= i2  \n\u003C= ≤ i1 \u003C= i2  \n&& and (i1 != i2)&& (i1 == i3)  \n|| and/or (i1 == i2) || (i1 == i3)  \nStatements:  \nif( condition ) { statements  \n}  \nif( condition ) { statements  \n}  \nelse {  \nstatements}  \nif( condition ) { statements  \n}  \nelse if { statements  \n}  \nelse { statements  \n}  \nswitch ( casevariable ) { case value1a :  \ncase value1b :{statements} break;  \ncase value2a :  \ncase value2b :{statements} break;  \ndefault:  \n{statements}}  \nRepetitions  \nwhile (conditions) { statements  \n}  \nfor ( init ; conditions; update ) { statements  \n}  \ndo {  \nstatements these statements are done before the while statement check  \n} while ( condition) ;  \nfunctions  \nA function is a set of commands. It is useful to write a user-de􀀌ned function, i.e. your own function, whenever you need to do the same task many times in the program. All programs start execution at the function main. For Functions you need steps 1-3:  \nStep 1: At the beginning of your program you need to declare any functions:  \nfunction type function  name (types  of  parameter  list);  \nexample 1: double feetinchtometer (int,double);  \nexample 2: void metertofeetinch (double, int&, double&); The function  type declares which variable is passed back from the function (void means none via the function type) . The variables without “&” are all input parameters, i","cbCaidRbX3NHCTjW","https://ap.wps.com/l/cbCaidRbX3NHCTjW","pdf",45972,"English","# Compiling C++ programs\n# Comments\n# Data Types\n# Input and Output\n# Arithmetic, Functions, and Operators\n# Decision Statements\n# Repetitions\n# Functions\n# Arrays","[{\"question\":\"How do you compile a C++ program using g++?\",\"answer\":\"You can compile with g++ and specify the output executable and source file, for example using -o to choose the executable name. The summary also notes an example pattern like g++ -o executable filename.cc filename.\"},{\"question\":\"What headers are needed for screen I/O and file I/O in C++?\",\"answer\":\"For screen input/output, include #include \\u003ciostream\\u003e and use cout and cin. For file input/output, include #include \\u003cfstream\\u003e, then use ofstream for output and ifstream for reading.\"},{\"question\":\"What are the common decision and loop statements in C++?\",\"answer\":\"Decision statements include if, else, else if, and switch with case labels and default. Repetition includes while, for (init; conditions; update), and do ... while, with conditions checked after executing the body in the do-while case.\"}]","C++ summary - basic commands, data types, input/output, and control statements | PDF",15,[145],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/49bf7c8e2a7322bf30cf445cf7094989.webp",983,1272,{"list":150,"token":66},[151,157,163,170,176,182,189,195,202,208],{"doc_id":152,"doc_title":153,"file_type":137,"home_preview_img_url":154,"slug":155,"view_count":24,"category_name":30,"create_tm":156},670905,"Java Cheat Sheet - Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988353128/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=PfjWXDTvxkOaEcKRy%2BMKqjEw3MI%3D","java-cheat-sheet-notes",1793572659,{"doc_id":158,"doc_title":159,"file_type":137,"home_preview_img_url":160,"slug":161,"view_count":19,"category_name":30,"create_tm":162},688769,"Code for Teens - The Awesome Beginner's Guide to Programming","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000666024/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=nYls4onKv2qLtqof2MUK1z01IOo%3D","code-for-teens-the-awesome-beginners-guide-to-programming",1794091476,{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":168,"category_name":30,"create_tm":169},423014,"THE JAVA LANGUAGE CHEAT SHEET - quick reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229922611453/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=1OtJ0KUGMK1McC7u%2FFdfSKRoRaI%3D","the-java-language-cheat-sheet-quick-reference",13,1790629749,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":19,"category_name":30,"create_tm":175},701213,"Modern C++ for Computer Vision - Lecture 2 - C++ Basic Syntax","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012053964/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=OrECKQKEHanQgHiTqC33dG6dll8%3D","modern-c-for-computer-vision-lecture-2-c-basic-syntax",1794524180,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":24,"category_name":30,"create_tm":181},685779,"Topic 6 - Lists, Sets, Tuples, Dictionaries","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203959/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=Ivzhs6oX%2BGDj6JR9WD2HpXbL11U%3D","topic-6-lists-sets-tuples-dictionaries",1794018231,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":187,"category_name":30,"create_tm":188},1651,"PHP Notes for Professionals","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229695272201/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=EhtXLvc89rWE2sConFhG7POMzqY%3D","php-notes-for-professionals",56,1776248257,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":81,"category_name":30,"create_tm":194},682644,"Visual QuickStart Guide - Python - Third Edition - Learn the quick and easy way","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999674919/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=YsZM3PZLJ3g8hrueKTsr4juMYfU%3D","visual-quickstart-guide-python-third-edition-learn-the-quick-and-easy-way",1793977303,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":200,"category_name":30,"create_tm":201},501611,"Sams Teach Yourself - C++ in One Hour a Day - 6th ed.","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229931378859/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=%2FfCYZTGW7lC5dlH1MhRMLMUn74o%3D","sams-teach-yourself-c-in-one-hour-a-day-6th-ed",17,1791021464,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":168,"category_name":30,"create_tm":207},423012,"Think Java - How to Think Like a Computer Scientist - Version 6.6.0","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229922611452/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=BzKFlk5ie7OuIDhJb8B7eWiRtWc%3D","think-java-how-to-think-like-a-computer-scientist-version-660",1790629747,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":46,"category_name":30,"create_tm":213},347081,"Java - Programming - Ninth Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910997878/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=epOtKxn7WXgpjMx45pgQAbHO28g%3D","java-programming-ninth-edition",1790065180]