### Revision history for TblComparisonC

#### Revision [24314]

Last edited on 2020-08-22 15:44:57 by fxm [corrected syntax from https://www.freebasic.net/forum/viewtopic.php?p=275262#p275262]
foo( a )##>>
{{fbdoc item="subsect" value="byval pointers to parameters"}}
foo( &a );##<<>>##declare sub foo( byval param as long ptr )
foo( @a )##>>
<<##void foo( int& param );
foo( a )##>>
##### Deletions:
foo( a );##>>
foo( &a );
void foo( int& param );
foo( a )##

#### Revision [22260]

Edited on 2018-04-06 04:38:47 by MrSwiss [corrected syntax from https://www.freebasic.net/forum/viewtopic.php?p=275262#p275262]
//Last reviewed by ""MrSwiss"" on April 6, 2018 Note: changed Integer to Long (where needed)//
##### Deletions:
//Last reviewed by ""MrSwiss"" on April 6, 2018 Note: Changed Integer to Long (where needed)//

#### Revision [22259]

Edited on 2018-04-06 04:32:18 by MrSwiss [Changed: Integer to Long (where needed)]
int a, b, c;##<<>>##dim a as long
dim as long a, b, c##>>
<<##int a;##<<>>##dim a as long = any##>>
<<##int a = 0;##<<>>##dim a as long##>>
<<##int a = 123;##<<>>##dim a as long = 123##>>
a[0] = 1;##<<>>##dim a(0 to 3) as long
*p = 123;##<<>>##dim a as long
dim p as long ptr
myfield as long
<<##typedef int myint;##<<>>##type myint as long##>>
<<##int foo( void );##<<>>##declare function foo( ) as long##>>
}##<<>>##function foo( ) as long
foo( a );##<<>>##declare sub foo( byval param as long )
foo( a );##<<>>##declare sub foo( byref param as long )
}##<<>>##for i as long = 0 to 9
//Last reviewed by ""MrSwiss"" on April 6, 2018 Note: Changed Integer to Long (where needed)//
##### Deletions:
int a, b, c;##<<>>##dim a as integer
dim as integer a, b, c##>>
<<##int a;##<<>>##dim a as integer = any##>>
<<##int a = 0;##<<>>##dim a as integer##>>
<<##int a = 123;##<<>>##dim a as integer = 123##>>
a[0] = 1;##<<>>##dim a(0 to 3) as integer
*p = 123;##<<>>##dim a as integer
dim p as integer ptr
myfield as integer
<<##typedef int myint;##<<>>##type myint as integer##>>
<<##int foo( void );##<<>>##declare function foo( ) as integer##>>
}##<<>>##function foo( ) as integer
foo( a );##<<>>##declare sub foo( byval param as integer )
foo( a );##<<>>##declare sub foo( byref param as integer )
}##<<>>##for i as integer = 0 to 9

#### Revision [21687]

Edited on 2016-11-07 08:58:56 by fxm [Formatting]
##<end-of-line>##>>
end-of-line>>

#### Revision [21667]

Edited on 2016-11-07 04:50:06 by fxm [Formatting]
<<**""C/C++""**<<>>**""FreeBASIC""**>>
int a, b, c;##<<>>##dim a as integer
<<##int a;##<<>>##dim a as integer = any##>>
<<##int a = 0;##<<>>##dim a as integer##>>
<<##int a = 123;##<<>>##dim a as integer = 123##>>
a[0] = 1;##<<>>##dim a(0 to 3) as integer
*p = 123;##<<>>##dim a as integer
*p = 123##>>
}##<<>>##type UDT
<<##typedef int myint;##<<>>##type myint as integer##>>
p->myfield = 123;##<<>>##dim x as UDT
<<##int foo( void );##<<>>##declare function foo( ) as integer##>>
}##<<>>##function foo( ) as integer
<<##void foo( void );##<<>>##declare sub foo( )##>>
}##<<>>##sub foo( )
foo( a );##<<>>##declare sub foo( byval param as integer )
foo( a );##<<>>##declare sub foo( byref param as integer )
foo( a )##
>>
<<>>##:##
}##<<>>##for i as integer = 0 to 9
}##<<>>##while condition
} while (condition);##<<>>##do
}##<<>>##if condition then
}##<<>>##select case a
char s[] = "Hello!";##<<>>##dim s as zstring ptr = @"Hello!"
}##<<>>##print "Hello!"##
>>
""/* foo */""##<<>>##' foo
###endif##<<>>###if //a//##
<<###ifdef _WIN32##<<>>###ifdef ""__FB_WIN32__""##>>
<<##foo.c, foo.h##<<>>##foo.bas, foo.bi##>>
<<##gcc foo.c -o foo##<<>>##fbc foo.bas##>>
##### Deletions:
<<**""C/C++""**>><<**""FreeBASIC""**>>
int a, b, c;##>><<##dim a as integer
<<##int a;##>><<##dim a as integer = any##>>
<<##int a = 0;##>><<##dim a as integer##>>
<<##int a = 123;##>><<##dim a as integer = 123##>>
a[0] = 1;##>><<##dim a(0 to 3) as integer
*p = 123;>><<##dim a as integer
*p = 123>>
}##>><<##type UDT
<<##typedef int myint;##>><<##type myint as integer##>>
p->myfield = 123;##>><<##dim x as UDT
<<##int foo( void );##>><<##declare function foo( ) as integer##>>
}##>><<##function foo( ) as integer
<<##void foo( void );##>><<##declare sub foo( )##>>
}##>><<##sub foo( )
foo( a );##>><<##declare sub foo( byval param as integer )
foo( a );##>><<##declare sub foo( byref param as integer )
foo( a )
##>>
>><<##:##
}##>><<##for i as integer = 0 to 9
}##>><<##while condition
} while (condition);##>><<##do
}##>><<##if condition then
}##>><<##select case a
char s[] = "Hello!";##>><<##dim s as zstring ptr = @"Hello!"
}##>><<##print "Hello!"
##>>
/* foo */##>><<##' foo
###endif##>><<###if //a//##
<<###ifdef _WIN32##>><<###ifdef ""__FB_WIN32__""##>>
<<##foo.c, foo.h##>><<##foo.bas, foo.bi##>>
<<##gcc foo.c -o foo##>><<##fbc foo.bas##>>

#### Revision [16406]

Edited on 2012-10-26 13:18:28 by CountingPine [More preprocessor conditionals]
{{fbdoc item="subsect" value="compile-time checks"}}
<<###if //a//##
###elif //b//##
###else##
###endif##>><<###if //a//##
###elseif //b//##
###else##
###endif##>>

#### Revision [16384]

Edited on 2012-10-18 11:36:06 by DkLwikki [better formatting]
{{fbdoc item="subsect" value="uninitialized variable"}}
##### Deletions:
{{fbdoc item="" value="uninitialized variable"}}

#### Revision [16383]

Edited on 2012-10-18 11:35:46 by DkLwikki [better formatting]
<<**""C/C++""**>><<**""FreeBASIC""**>>
{{fbdoc item="subsect" value="variable declaration"}}
int a, b, c;##>><<##dim a as integer
dim as integer a, b, c##>>
{{fbdoc item="" value="uninitialized variable"}}
<<##int a;##>><<##dim a as integer = any##>>
{{fbdoc item="subsect" value="zero-initialized variable"}}
<<##int a = 0;##>><<##dim a as integer##>>
{{fbdoc item="subsect" value="initialized variable"}}
<<##int a = 123;##>><<##dim a as integer = 123##>>
{{fbdoc item="subsect" value="array"}}
a[0] = 1;##>><<##dim a(0 to 3) as integer
a(0) = 1##>>
{{fbdoc item="subsect" value="pointer"}}
*p = 123;>><<##dim a as integer
*p = 123>>
{{fbdoc item="subsect" value="structure, user-defined type"}}
}##>><<##type UDT
end type##>>
{{fbdoc item="subsect" value="typedef, type alias"}}
<<##typedef int myint;##>><<##type myint as integer##>>
{{fbdoc item="subsect" value="struct pointer"}}
p->myfield = 123;##>><<##dim x as UDT
p->myfield = 123##>>
{{fbdoc item="subsect" value="function declaration"}}
<<##int foo( void );##>><<##declare function foo( ) as integer##>>
{{fbdoc item="subsect" value="function body"}}
}##>><<##function foo( ) as integer
end function##>>
{{fbdoc item="subsect" value="sub declaration"}}
<<##void foo( void );##>><<##declare sub foo( )##>>
{{fbdoc item="subsect" value="sub body"}}
}##>><<##sub foo( )
end sub##>>
{{fbdoc item="subsect" value="byval parameters"}}
foo( a );##>><<##declare sub foo( byval param as integer )
foo( a );##>>
{{fbdoc item="subsect" value="byref parameters"}}
foo( a );##>><<##declare sub foo( byref param as integer )
foo( a )
##>>
{{fbdoc item="subsect" value="statement separator"}}
>><<##:##
end-of-line>>
{{fbdoc item="subsect" value="for loop"}}
}##>><<##for i as integer = 0 to 9
next##>>
{{fbdoc item="subsect" value="while loop"}}
}##>><<##while condition
wend##>>
{{fbdoc item="subsect" value="do-while loop"}}
} while (condition);##>><<##do
loop while condition##>>
{{fbdoc item="subsect" value="if block"}}
}##>><<##if condition then
end if##>>
{{fbdoc item="subsect" value="switch, select"}}
}##>><<##select case a
end select##>>
{{fbdoc item="subsect" value="string literals, zstrings"}}
char s[] = "Hello!";##>><<##dim s as zstring ptr = @"Hello!"
dim s as zstring * 6+1 = "Hello!"##>>
{{fbdoc item="subsect" value="hello world"}}
}##>><<##print "Hello!"
##>>
/* foo */##>><<##' foo
/' foo '/##>>
{{fbdoc item="subsect" value="compile-time target system checks"}}
<<###ifdef _WIN32##>><<###ifdef ""__FB_WIN32__""##>>
<<##foo.c, foo.h##>><<##foo.bas, foo.bi##>>
{{fbdoc item="subsect" value="typical compiler command to create an executable"}}
<<##gcc foo.c -o foo##>><<##fbc foo.bas##>>
##### Deletions:
<<""C/C++"">><<""FreeBASIC"">>
{{fbdoc item="section" value="variable declaration"}}
int a, b, c;##
>><<##dim a as integer
dim as integer a, b, c##
>>
{{fbdoc item="section" value="uninitialized variable"}}
<<##int a;##
>><<##dim a as integer = any##
>>
{{fbdoc item="section" value="zero-initialized variable"}}
<<##int a = 0;##
>><<##dim a as integer##
>>
{{fbdoc item="section" value="initialized variable"}}
<<##int a = 123;##
>><<##dim a as integer = 123##
>>
{{fbdoc item="section" value="array"}}
a[0] = 1;##
>><<##dim a(0 to 3) as integer
a(0) = 1##
>>
{{fbdoc item="section" value="pointer"}}
*p = 123;
>><<##dim a as integer
*p = 123
>>
{{fbdoc item="section" value="structure, user-defined type"}}
}##
>><<##type UDT
end type##
>>
{{fbdoc item="section" value="typedef, type alias"}}
<<##typedef int myint;##
>><<##type myint as integer##
>>
{{fbdoc item="section" value="struct pointer"}}
p->myfield = 123;##
>><<##dim x as UDT
p->myfield = 123##
>>
{{fbdoc item="section" value="function declaration"}}
<<##int foo( void );##
>><<##declare function foo( ) as integer##
>>
{{fbdoc item="section" value="function body"}}
}##
>><<##function foo( ) as integer
end function##
>>
{{fbdoc item="section" value="sub declaration"}}
<<##void foo( void );##
>><<##declare sub foo( )##
>>
{{fbdoc item="section" value="sub body"}}
}##
>><<##sub foo( )
end sub##
>>
{{fbdoc item="section" value="byval parameters"}}
foo( a );##
>><<##declare sub foo( byval param as integer )
foo( a );##
>>
{{fbdoc item="section" value="byref parameters"}}
foo( a );##
>><<##declare sub foo( byref param as integer )
foo( a )##
>>
{{fbdoc item="section" value="statement separator"}}
>><<##:##, end-of-line
>>
{{fbdoc item="section" value="for loop"}}
}##
>><<##for i as integer = 0 to 9
next##
>>
{{fbdoc item="section" value="while loop"}}
}##
>><<##while condition
wend##
>>
{{fbdoc item="section" value="do-while loop"}}
} while (condition);##
>><<##do
loop while condition##
>>
{{fbdoc item="section" value="if block"}}
}##
>><<##if condition then
end if##
>>
{{fbdoc item="section" value="switch, select"}}
}##
>><<##select case a
end select##
>>
{{fbdoc item="section" value="string literals, zstrings"}}
char s[] = "Hello!";##
>><<##dim s as zstring ptr = @"Hello!"
dim s as zstring * 6+1 = "Hello!"##
>>
{{fbdoc item="section" value="hello world"}}
}##
>><<##print "Hello!"##
>>
/* foo */##
>><<##' foo
/' foo '/##
>>
{{fbdoc item="section" value="compile-time target system checks"}}
<<###ifdef _WIN32##
>><<###ifdef ""__FB_WIN32__""##
>>