![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#11
|
|||
|
|||
Re: 1 loop structure to find the sum of odd and even integersI use the following code,
CPP / C++ / C Code:
Last edited by admin : 29-Oct-2009 at 03:35.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|||
|
#12
|
||||
|
||||
Re: 1 loop structure to find the sum of odd and even integersQuote:
Any "system" call is, by its very nature, going to be platform specific and the "pause" executable typically is not available on Unix or Mac, rather, only DOS and Windows. You need to read the GUIDELINES. MxB |
|
#13
|
|||
|
|||
Re: 1 loop structure to find the sum of odd and even integersDoes it mean that same c++ code can not be run on different platforms? A programmer has to keep in mind the operating system first and then write the code.
|
|
#14
|
||||
|
||||
Re: 1 loop structure to find the sum of odd and even integersQuote:
...in many cases one can easily write C++ code that does not perform as intended (desired). A good example is code that expects data to be in little endian format when executing on a big endian machine or vice versa. Another is when using calls that invoke operating system specific "capabilites" such as the standard C library "system" call. You are passing in the name of an "executable" (a command) in the form of a const char* variable. It is possible for the C (or C++ in this case) code to compile without error or warning if I write the following: CPP / C++ / C Code:
...I'm guessing that there are not going to be many "systems" out there that offer the do_floop_bloak_neffer_yarndote command. In your case, the "pause" command is available because your particular system exposes it to the command line. Quote:
...or at least avoid any platform-specific code. MxB |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The