Difference between revisions of "Pascal for C users"

From Free Pascal wiki
Jump to navigationJump to search
Line 118: Line 118:
 
{|   border="1" style="margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px  solid; border-collapse: collapse;"
 
{|   border="1" style="margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px  solid; border-collapse: collapse;"
 
!   C type   
 
!   C type   
!   [[Pascal]] type  
+
!   [[Pascal]] [[Data_type|type]]  
 
!   Size (bits)  
 
!   Size (bits)  
 
|-
 
|-

Revision as of 18:25, 10 November 2007

  C     Pascal  
  {     Begin    
  }     End  
  =     :=   Becomes  
  ==     =   Equal
  /     /   Division (or sometimes div)  
  %     Mod  
  !     Not  
  !=     <>   Not equal  
  &&     And  
  ||     Or  
  ^     Xor  
  >>     Shr   bit shift right  
  <<     Shl   bit shift left  
  ++     Inc  
  --     Dec  
  /*     {  
  */     }  
  //     //  
  if()     If Then  
  if() else     If Then Else  
  while     While Do  
  do while     Repeat Until Not   
  do while !     Repeat Until    
  for ++     For To Do  
  for --     For Downto Do    
  switch case break     Case Of End  
  switch case break default     Case Of Else End    


  C type     Pascal type     Size (bits)  
  char     Char     8-bit
  signed char     Shortint   8-bit
  unsigned char     Byte   8-bit
  char*     PChar   (32-bit)
  float     Single   32-bit
  double     Double   64-bit