Jump to content
  • Advertisement
Sign in to follow this  
Sugavanas

Change the compiler of c++ 11

This topic is 2149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Thanks but i want to change the compiler because I use a book which uses c++ to teach but i feel comfortable using vs 12 and i also need the same results as it is in code blocks. thats why

Share this post


Link to post
Share on other sites
The thing is in codeblocks the console does not end after it starts but in vs it just closes and i can't see a thing, for example use this code in vs and codeblocks in an console app,

#include <iostream>
using namespace std;
int main()
{
//Chapter 2 : Additon code

//Chapter 2 : Divisional code
int first, second;
cout << "Dividing 28 by 14." << endl;
first = 28;
second = 14;
cout << "Quotient " << first / second << endl;
cout << "Remainder " << first % second << endl;
cout << "Dividing 32 by 6." << endl;
first = 32;
second = 6;
cout << "Quotient " << first / second << endl;
cout << "Remainder " << first % second << endl;
//chapter 2 : char
cout << "Char " << first / second << endl;
char ch;
ch = 'a';
cout << ch << endl;
char c;
c = '\0';
cout << c << endl;
cout << "hif" << endl;
return 0;

}

Share this post


Link to post
Share on other sites
As LennyLen said, you can keep the console open after exit in VS also. This is not the result of the compiler, but the result of how the IDE handles your application. So even if you would have used the VS IDE with another compiler, it is still VS that is either keeping the console open or closing it after the program exits.

For example, in VS you can run the application with (F5) or without (CTRL-F5) the debugger. If you run the application with the debugger, the IDE will close the console immediately, and if you run it without the debugger, it will keep the console open after it exits.

Share this post


Link to post
Share on other sites
Alternately you can just set a break point at the closing brace for the main() function. Just click the margin on the left of the closing brace in the IDE.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!