CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 59

Threaded View

  1. #22
    Join Date
    Apr 2009

    Re: how can i convert write() procedure to cout?

    Quote Originally Posted by laserlight View Post
    It depends. I have no clue what is the syntax and semantics of this programming language that you are trying to design and implement. What I do know is that whatever the syntax, you can translate a write to standard output in that language to C++ code involving std::cout, without having to write some C++ function (template, or class) with the C++ syntax that you have in mind. In other words, concentrating on C++ seems like it is taking you off course. Rather, concentrate on the syntax and semantics of your language, and how you will be translating that into C++ without unnecessary frills.
    see these:

    write("hello world" , NewLine, varname1)

    to c++:

    'write(' -> 'std::cout <<';

    ',' - > '<<';

    'Newline' -> 'std::endl'

    then i can delete the last ')' and add the ';'

    (even for Read(varname1) is more or less the same.. except the Read() that must be '_getch()'. the 'cin' don't do the job, i think)
    it's easy to translate
    Last edited by Cambalinho; August 20th, 2013 at 10:48 AM.

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.