\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Fahad (Zilard)} \pdfinfo{ /Title (c-exam-1.pdf) /Creator (Cheatography) /Author (Fahad (Zilard)) /Subject (C++ Exam 1 Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{B8B853} \definecolor{LightBackground}{HTML}{FAFAF4} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{C++ Exam 1 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Fahad (Zilard)} via \textcolor{DarkBackground}{\uline{cheatography.com/164660/cs/34499/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Fahad (Zilard) \\ \uline{cheatography.com/zilard} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 8th October, 2022.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Definitions}} \tn % Row 0 \SetRowColor{LightBackground} Algorithm & A guide of steps to solution. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Flowcharts & Graphical representation of algorithm \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Pseudocode & Language used to represent algorithm. \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Preprocessing Directives & Commands that are preceded by the \# sign \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} Memory & Used to store information for immediate use \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} Bit & Stores 0 or 1 \tn % Row Count 11 (+ 1) % Row 6 \SetRowColor{LightBackground} Byte & Group of eight bits \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Comments}} \tn % Row 0 \SetRowColor{LightBackground} Line comment & // text \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Block comment & / * text * / \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.93643 cm} x{2.04057 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Output \& Input Statements}} \tn % Row 0 \SetRowColor{LightBackground} cout (Print) & cout\textless{}\textless{}"text"; \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} cin (Request input) & cin\textgreater{}\textgreater{}variable \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Constants}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Used to represent values used throughout the program.% Row Count 2 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Constants should be named in uppercase letters.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4577 cm} x{1.28156 cm} x{2.83774 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Escape Sequences}} \tn % Row 0 \SetRowColor{LightBackground} \textbackslash{}n & Newline & Cursor moves to next line \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \textbackslash{}t & Tab & Cursor moves to next tab stop \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \textbackslash{}b & Backspace & Cursor moves one space to left \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \textbackslash{}r & Return & Cursor returns to beginning of current line \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \textbackslash{}\textbackslash{} & Backslash & Backslash is printed \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} \textbackslash{}' & single quotation & single quotation is printed \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} \textbackslash{}" & Double quotation & Double quotation is pritned \tn % Row Count 13 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.03597 cm} x{1.94103 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Literals}} \tn % Row 0 \SetRowColor{LightBackground} integer & 4 \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} floating point & 3.1415926 \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} string & "string" \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Boolean & false \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} character & 'A' \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.14471 cm} x{3.83229 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Data types}} \tn % Row 0 \SetRowColor{LightBackground} int & integer literals \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} float & floating point literals \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} double & floating point literals \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} string & string literal \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} char & character literal \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} bollean & boolean literal \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Hierarchy of Types}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{long double (Highest)} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{double} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{float} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{unsigned long} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{long} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{unsigned int} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{int} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{char (Lowest)} \tn % Row Count 8 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Type Conversion}} \tn % Row 0 \SetRowColor{LightBackground} Implicit Type Coercion & Automatic change in type of value \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Type Coercion & Automatic change of an operand to another type \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Promotion & Convert to higher type \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} Demotion & Convert to lower type \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Casting}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Also called type casting. Used for manual data type conversion.% Row Count 2 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Format: \newline static\_cast\textless{}type\textgreater{}(expression)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.88206 cm} x{1.09494 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{PEMDAS (Order of Operations)}} \tn % Row 0 \SetRowColor{LightBackground} Parentheses & {[}{]}, () \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Multiplication \& Division & *, /, \% \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Addition and Subtraction & +, - \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Switch Statements}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{switch ( variable ) \newline % Row Count 1 (+ 1) \{ \newline % Row Count 2 (+ 1) case value1: \newline % Row Count 3 (+ 1) // do something \newline % Row Count 4 (+ 1) break; \newline % Row Count 5 (+ 1) case value2: \newline % Row Count 6 (+ 1) // do something else \newline % Row Count 7 (+ 1) break; \newline % Row Count 8 (+ 1) default: \newline % Row Count 9 (+ 1) // do something by default \newline % Row Count 10 (+ 1) break; \newline % Row Count 11 (+ 1) \}% Row Count 12 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Converting between Switch \& if}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{switch ( variable ) \newline % Row Count 1 (+ 1) \{ \newline % Row Count 2 (+ 1) case value1: \newline % Row Count 3 (+ 1) // do something \newline % Row Count 4 (+ 1) break; \newline % Row Count 5 (+ 1) case value2: \newline % Row Count 6 (+ 1) // do something else \newline % Row Count 7 (+ 1) break; \newline % Row Count 8 (+ 1) default: \newline % Row Count 9 (+ 1) // do something by default \newline % Row Count 10 (+ 1) break; \newline % Row Count 11 (+ 1) \}% Row Count 12 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{This is equivalent to:}} \newline \newline if ( variable == value1 ) \newline \{ \newline // do something \newline \} \newline else if ( variable = value2 ) \newline \{ \newline // do something else \newline \} \newline else \newline \{ \newline // do something by default \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4577 cm} x{3.43275 cm} p{0.68655 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Arithmetic Operators}} \tn % Row 0 \SetRowColor{LightBackground} + & Addition & x+y \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} - & Subtraction & x-y \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} * & Multiplication & x*y \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} / & Division & x/y \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \% & Modulus (integer arithmetic) & x \% y \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4577 cm} x{3.24967 cm} p{0.86963 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Relational Operators}} \tn % Row 0 \SetRowColor{LightBackground} \textless{} & Less than & x \textless{} y \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \textgreater{} & Greater than & x \textgreater{} y \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \textless{}= & Less than or equal to & x \textless{}= y \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \textgreater{}= & Greater than or equal to & x \textgreater{}=y \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} != & Not equal to & x != y \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4577 cm} p{0.4577 cm} x{3.6616 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Logical Operators}} \tn % Row 0 \SetRowColor{LightBackground} \&\& & AND & NEw relational expression is true if both expressions are true \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} !! & OR & New relation expression is true if either is true \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} ! & NOT & Reverses the value of an expression. True to false and false to true \tn % Row Count 7 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{Order from highest to lowest: !, \&\&, ||} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Precedence for ALL Operators}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Arithmetic Operators (Highest)} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Relational Operators} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Logical Operators (Lowest)} \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Increment and Decrement}} \tn % Row 0 \SetRowColor{LightBackground} prefix & ++x,-{}-y \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} postifx & x++,y-{}- \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{For prefix, the value changes and then get evaluated, and vice versa for the postfix.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Control Flow - If Statements}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{if ( conditional ) \newline % Row Count 1 (+ 1) \{ \newline % Row Count 2 (+ 1) // do something \newline % Row Count 3 (+ 1) \} \newline % Row Count 4 (+ 1) else if ( another\_conditional ) \newline % Row Count 5 (+ 1) \{ \newline % Row Count 6 (+ 1) // do something else \newline % Row Count 7 (+ 1) \} \newline % Row Count 8 (+ 1) else \newline % Row Count 9 (+ 1) \{ \newline % Row Count 10 (+ 1) // do something as default \newline % Row Count 11 (+ 1) \}% Row Count 12 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Control Flow - While Loops}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{while ( conditional ) \newline % Row Count 1 (+ 1) \{ \newline % Row Count 2 (+ 1) // do something \newline % Row Count 3 (+ 1) \}% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{For Loops}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{for ( initialization; test; command ) \newline % Row Count 1 (+ 1) \{ \newline % Row Count 2 (+ 1) // do something \newline % Row Count 3 (+ 1) \}% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Converting Between For \& While}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{for ( initialization; test; command ) \newline % Row Count 1 (+ 1) \{ \newline % Row Count 2 (+ 1) // do something \newline % Row Count 3 (+ 1) \}% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{this is equivalent to:}} \newline initialization; \newline while( test ) \newline \{ \newline // do something \newline command; \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}