hisherwin Posted December 15, 2013 Author Share Posted December 15, 2013 ![](https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-frc3/1468546_590798730989140_138011184_n.jpg)i started using code::blocks last friday (Dec. 13, 2013)but the syntax is kinda same as Vb6 so i got used to it in just 2 days.. Just one question.. How do you compile on C++ ? i found the compile button but, it won't work? Link to comment Share on other sites More sharing options...
Helladen Posted December 16, 2013 Share Posted December 16, 2013 Use Visual Studio. Link to comment Share on other sites More sharing options...
Orbegon Posted December 16, 2013 Share Posted December 16, 2013 Looks neat, like a home-made calculator. Link to comment Share on other sites More sharing options...
Sealbreaker Posted December 16, 2013 Share Posted December 16, 2013 Is there no "\n" for new line in c++ ? I think that would make your life easier :DI'm doing C for university right now and don't know too much about c++ but as you can use C in C++, I think that would be possible.Somehow I like using scanf() and printf() way better. The way you did it with cin and cout just doesn't look as clean.I also asked myself why you only print out the result when it is positive, as substraction can easily create a negative result and why wouldn't you show that to the user? It's always fun to make the best out of your learning projects and it might give you a better attitude for later, bigger projects.Anyhow, nice little start (nothing worthy showing off but meh, good that you are motivated ;D)keep on learning!-seal Link to comment Share on other sites More sharing options...
PD Posted December 16, 2013 Share Posted December 16, 2013 > Is there no "\n" for new line in c++ ? I think that would make your life easier :DYes you can use "\n" but "endl" is far prettier.Does compile give you an error or can't you find the compiled application? If you can't find it, look in the "bin" folder. Link to comment Share on other sites More sharing options...
Domino_ Posted December 16, 2013 Share Posted December 16, 2013 Click Compile & Run, because c++ cant run your code if he havent made and *.exe file of it.Compiled project should be next to your project, or else somewhere where you saved it. Link to comment Share on other sites More sharing options...
hisherwin Posted December 17, 2013 Author Share Posted December 17, 2013 Well when i click compile it sometimes say "nothing to do here blah blah blah" like that.. how can i build the *.exe? Link to comment Share on other sites More sharing options...
hisherwin Posted December 17, 2013 Author Share Posted December 17, 2013 > Use Visual Studio.Where can i get the full installer of it? that doesn't require internet connection. Link to comment Share on other sites More sharing options...
Helladen Posted December 17, 2013 Share Posted December 17, 2013 This is the free version. Do not tag me as a pirate by linking it on a site known for piracy.[Visual Studio 2010 Express](http://www.visualstudio.com/en-us/downloads#d-2010-express) Link to comment Share on other sites More sharing options...
hisherwin Posted December 17, 2013 Author Share Posted December 17, 2013 > This is the free version. Do not tag me as a pirate by linking it on a site known for piracy.> [Visual Studio 2010 Express](http://www.visualstudio.com/en-us/downloads#d-2010-express)Right.. thanks, i'll check it up once i got a torrent xDi'll stick on Code::Blocks while i'm studying Link to comment Share on other sites More sharing options...
TheHumanMunk Posted January 4, 2014 Share Posted January 4, 2014 > Yes you can use "\n" but "endl" is far prettier.> > > > Does compile give you an error or can't you find the compiled application? If you can't find it, look in the "bin" folder.It's not just prettier, 'endl' is cross-platform while '\n' is not cross-platform! :)On topic:@OP, you should use the Switch statement instead of the If statement ;) Link to comment Share on other sites More sharing options...
hisherwin Posted January 5, 2014 Author Share Posted January 5, 2014 > It's not just prettier, 'endl' is cross-platform while '\n' is not cross-platform! :)> > > > On topic:> > @OP, you should use the Switch statement instead of the If statement ;)Uhm, sorry but what Switch statement do ?how does it function? Link to comment Share on other sites More sharing options...
PD Posted January 5, 2014 Share Posted January 5, 2014 > Uhm, sorry but what Switch statement do ?> > > > how does it function?Switch = Select Case. Link to comment Share on other sites More sharing options...
hisherwin Posted January 6, 2014 Author Share Posted January 6, 2014 Sample code? i don't understand theory or explanation, it's more easy to understand with a sample.. xD Link to comment Share on other sites More sharing options...
Sealbreaker Posted January 7, 2014 Share Posted January 7, 2014 Why don't you just google "Switch in c++" ?Searching & Learning on your own is definately a required skill for programming.-seal Link to comment Share on other sites More sharing options...
hisherwin Posted January 8, 2014 Author Share Posted January 8, 2014 > Why don't you just google "Switch in c++" ?> > Searching & Learning on your own is definately a required skill for programming.> > > > -sealThere are few things i can't do on Phone than on Web.. it's too slow on phone xD Link to comment Share on other sites More sharing options...
deathtaker26 Posted January 8, 2014 Share Posted January 8, 2014 good to see people picking up on C++, I'm took a course on it 2 years ago and haven't touched on it since, I use mono and C#. Link to comment Share on other sites More sharing options...
hisherwin Posted January 9, 2014 Author Share Posted January 9, 2014 > good to see people picking up on C++, I'm took a course on it 2 years ago and haven't touched on it since, I use mono and C#.Erm, we don't have a Programming Subject on school .. Only HTML (even on collage)but i'm interested on programming that's why i'm doing self-studying, i can't learn fast enough xD Link to comment Share on other sites More sharing options...
Pazuzu Posted January 9, 2014 Share Posted January 9, 2014 thmm… I think you does not have a compiler installed. Do you download codeblock with minGW? Codeblock is just the IDE but minGW is the compiler... So that is why you cannot compile your program. Either you download the version with minGW or download the compiler yourself. Link to comment Share on other sites More sharing options...
hisherwin Posted January 12, 2014 Author Share Posted January 12, 2014 once i got an internet, i'll download Visual Studio 2010 Link to comment Share on other sites More sharing options...
Marsh Posted October 10, 2014 Share Posted October 10, 2014 > It's not just prettier, 'endl' is cross-platform while '\n' is not cross-platform! :)How is \n not cross platform? The function that writes to the file will recognize the character and put the correct necessary end line character/s.endl and \n are basically the same. Personally I like \n and see it in the industry I am not sure I have ever seen a endl. Also endl flushes the buffer afterwards and can have a hit on performance. Link to comment Share on other sites More sharing options...
demon xxx x Posted October 10, 2014 Share Posted October 10, 2014 > How is \n not cross platform? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now