Thread: how to re write this in C

  1. #16
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Quote Originally Posted by Elysia View Post
    This is the C++ forum, not the C forum, ya know...
    Quote Originally Posted by jeromey55
    can someone put this into C please so i can use it in C++
    I don't think he knows which language he's trying to use.
    If you understand what you're doing, you're not learning anything.

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Which is kind of my point. On one side, we have someone who claims this is supposed to be "rewritten" to C++, and on one hand, we have someone who posts C code.
    So we need to make a decision. Is this C? Or is this C++? If it's C, then it shouldn't be here.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    The original code looks like pascal, for the most part, whatever it is, surely even an elementary grasp of c would have allowed you to convert the lines, or post an attempt, simply hoiking the code within main() is not going to happen.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  4. #19
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    Quote Originally Posted by rogster001 View Post
    The original code looks like pascal, for the most part, whatever it is, surely even an elementary grasp of c would have allowed you to convert the lines, or post an attempt, simply hoiking the code within main() is not going to happen.
    No, its syntax has nothing to pascal, BASIC I would say.

  5. #20
    The larch
    Join Date
    May 2006
    Posts
    3,573
    As to guessing the language, it says so in the code!

    % abs needed because turing stores reals with a potential small error
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  6. #21
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    No, its syntax has nothing to pascal, BASIC I would say.
    you saying this is not found pascal?
    var
    :=

    Those things i remember, from code classes and they are certainly included in the scripting language supported by inno setup

    but ye it says turing
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  7. #22
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    Quote Originally Posted by rogster001 View Post
    you saying this is not found pascal?
    var
    :=

    Those things i remember, from code classes and they are certainly included in the scripting language supported by inno setup

    but ye it says turing
    Curly braces { } don't necessary indicate C.

    @anon: I didn't even know there is a 'turing' language, I though it was somehow related to Turing Machine.
    I know pascal, but not BASIC.
    Last edited by kmdv; 02-23-2011 at 11:13 AM.

  8. #23
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    I didn't even know there is a 'turing' language
    See this Turing


    Jim

  9. #24
    Registered User
    Join Date
    Feb 2011
    Posts
    12
    ya im pretty sure it was turing because my firend tried it and it worked in turing and thank you very much sipher

  10. #25
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Hey, why all the fuss? He asked for C code, i posted C code. If you disagree just move the thread. Anyway, in whatever language it was in, was easy to understand after all.
    Devoted my life to programming...

  11. #26
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    And it's one less homework assignment jeromey has to worry about failing. Good luck on those tests, though!

  12. #27
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Quote Originally Posted by rags_to_riches View Post
    And it's one less homework assignment jeromey has to worry about failing. Good luck on those tests, though!
    Devoted my life to programming...

  13. #28
    Registered User
    Join Date
    Feb 2011
    Posts
    12
    it wasnt really a homework assignment it was just a challenbge he put out to use

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 03-18-2006, 11:25 AM
  2. program to make a floppy write protected
    By shrijeetp in forum C Programming
    Replies: 1
    Last Post: 10-03-2005, 06:00 AM
  3. Reroute where programs write to
    By willc0de4food in forum C Programming
    Replies: 7
    Last Post: 09-21-2005, 04:48 PM
  4. Function to write string 3 times
    By Giggs in forum C++ Programming
    Replies: 15
    Last Post: 12-24-2002, 04:00 PM
  5. write(), read()
    By RedRum in forum C++ Programming
    Replies: 5
    Last Post: 06-09-2002, 11:45 AM