Hello,
I am presently referring to C++ primer (by Lippman, Lajoie, Moo) for C++ programming.
Now for a simple addition program, book "C++ primer" documents following progam (which is compiled by MinGW compiler of bloodshed Dev C++ IDE:
[code=c]#include <iostream>
int main()
{
std :: cout << "Enter two numbers : " << std :: endl;
int v1, v2;
std :: cin >> v1 >> v2 ;
std :: cout << "The sum of " << v1 << " and " << v2 << " is " << v1+v2 << std :: endl;
return(0);
}
[/code]
But in my college my lecturers refer using Borland Turbo C++ 3.0 compiler/IDE. The above code doesnot compiles in Turbo C++. Instead turbo C++ (and my teacher too) wants me to write something like:
Now I am in dilemma. What should I follow- The standard (as in C++ primer) or the one required by Turbo C++ (and my lecturer too)?
Thanks.......
AmbrNewlearner
I am presently referring to C++ primer (by Lippman, Lajoie, Moo) for C++ programming.
Now for a simple addition program, book "C++ primer" documents following progam (which is compiled by MinGW compiler of bloodshed Dev C++ IDE:
[code=c]#include <iostream>
int main()
{
std :: cout << "Enter two numbers : " << std :: endl;
int v1, v2;
std :: cin >> v1 >> v2 ;
std :: cout << "The sum of " << v1 << " and " << v2 << " is " << v1+v2 << std :: endl;
return(0);
}
[/code]
But in my college my lecturers refer using Borland Turbo C++ 3.0 compiler/IDE. The above code doesnot compiles in Turbo C++. Instead turbo C++ (and my teacher too) wants me to write something like:
Code:
#include <iostream.h> int main() { cout << "Enter two numbers : "; int v1, v2; cin >> v1 >> v2 ; cout << "The sum of " << v1 << " and " << v2 << " is " << v1+v2; return(0); }
Thanks.......
AmbrNewlearner
Comment