Results 1 to 4 of 4

Thread: Tip with C translation

  1. #1

    Tip with C translation

    hi, i've found this:
    Code:
      if(b>max) max=b,index=1;
      if(c>max) max=c,index=2;
    is this translation right:
    [pascal]
    if(b>max) then begin max:=b;index:=1; end;
    if(c>max) then begin max:=c;index:=2; end;
    [/pascal]

    How comes the assignement are separated by "," instead of ";" ?

    thanks
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  2. #2

    Tip with C translation

    I think that would be an accurate translation, but I would tidy up the code and not have it all on one line .

    C has way too many short-cut coding styles which sometimes make the code hard to follow.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #3
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Tip with C translation

    Right on the money dude.

    Oh I have to add this; Types, types, types! They make a world of difference ESPECIALLY if you are working with extern calls from DLL files.

    An Int in C is NOT an Integer in Pascal. And I think the same with a Float and a Real...not 100% on that one though.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #4

    Tip with C translation

    Well if you look at .NET specs you can see Borland ideeas are being used by MS, strong, clear types, system unit.
    Unfortunately there are many people wich dont even know Object Pascal exists and wonder what this Delphi thingy is.
    Object Pascal rulez, wake up people.
    The future must be... Fast and OpenSource so...
    <br />Think Open and Lightning Fast!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •