Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

I learned things!


hisherwin
 Share

Recommended Posts

![](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

Is there no "\n" for new line in c++ ? I think that would make your life easier :D

I'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

> Is there no "\n" for new line in c++ ? I think that would make your life easier :D

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.
Link to comment
Share on other sites

> 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 xD

i'll stick on Code::Blocks while i'm studying
Link to comment
Share on other sites

  • 3 weeks later...
> 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

> 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

> 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

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

  • 8 months later...
> 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...