Anda di halaman 1dari 1
‘joototnoununesmnanzanyennsnsoco20131010110%¢ Sennen C++ Reference Sheet Include Headers include ‘Common Headers ostream steam, math, cetyp. sting Namespace Using namespace st Data Types int har fot, double, void, boot Comments Mcomment text ‘> Mune comment text” Arithmetic Operators + (Adon), (Subirecton), * (Mutilation), /(Drsion), % (Modus) Relational Operators «(Less Than), ©= (Less Than or Equa To)» (Greater Than). (Greather Than or Equal To) == (Equal To), (Not Equal To) Logical Operators Ii dogial OR), 88 fogic! AND), | (ogical NOT) Pointers Int pr Define pointer pir® Svar /ptr set address of var vere = “pr Set var, fo value of varb NEtee itf) { :;) 1 sstatement>: While Loop wile () f : } o-While Loop oy : wie (condition) Switch Statement sun cexpresson) (280 : ‘staloment sequence 2> break, case ‘Statement sequence n+1>; break {[eteut: Statement sequence > break] ) arrays ‘2NoW 5 element array int myAraylot ‘Tamray index stats at 0 ‘ahevess 3rd Eiemont Imyarray(2=var, 0 Operators: >> put Operator << /Ouiput Operator in >> var, var2, vars out << "TEXT. "<< varl << end Ch getchar* butler, sreamsize num, char delim File wo {stream fe ‘Ae opent'flename"> var fie << "Text "<< var << end Read Entire Line getline (fie.ine) Reading Witng Binary Data fe eactmemory block siz) fie wntelmemon/_ock. sz): ie lose, File Mode Constants fos:in /Opens fie foreacng fos: out Opens fle for writing ate /Seeks the EOFUO operations can occur anywhere ‘app Causes output tobe appended at EOF ttune Destroys the previous contents mocreate //Causes open) fo fa fle doesnt aready exist les:noreplace Causes opend (ofa fe aeady exits Function Prototype ‘return dattype> (parameter ist) {body 6f he Tuncton } Structure Prototype tuct estructurs-mame> { ‘member type? member_nome' ‘membertype2 member_name2: J eobjecL name>: ‘Accessing Data Structures ‘Bcoess member Venable from StrucvOlass ‘nyStructmembenvar!= var, ‘Mal Cass Method ‘myClass,method args) ‘Ponter to StucvClass (myStructType “pr, pir= &myStuct irsmembervart = var, Download More Reference Sheets & Get Programming Help @ http://www.dreamincode.net at i i St on ak ie ret ea

Anda mungkin juga menyukai