Follow us on Twitter!
Ideas are far more powerful than guns.
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 23
Guests Online: 20
Members Online: 3

Registered Members: 82889
Newest Member: Geriztul
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

RE: Just starting C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 09-10-08 03:24
interslice wrote:
Hey guys.. i thought i would get into learning C++ and I've borrowed a book on the topic. There is a code in the book, that is supposed to work but its not working for me :

Code
#include <iostream.h>

void main(void)
  {
      cout << "Hello Everyone";
  }





This is exactly as it is in the book. Am i doing something wrong? Or is the book out of date?

That looks like a horrible mixture between C and C++. You say you are coding in C++? Then here are some pointers
-C headers are in the format of <example.h> or <cexample>
-C++ headers are in the format of <example>
-in C, the main function can return any type you please
-In C++, the main function has to be of type int (integer).

The code should look like
Code

#include <iostream>
using namespace std;
//Note that inside the main() parentheses, you may see a variety of //different parameters.
int main(){
cout<<"Hello Everyone!";
return 0;
}





Some up to date sources:
http://cprogrammi. . .
http://cplusplus.com
http://www.youtub. . .r/antiRTFM




Edited by on 09-10-08 03:32
Author

RE: Just starting C++

interslice
Member

Your avatar

Posts: 121
Location: my place of course!
Joined: 05.10.05
Rank:
Newbie
Posted on 09-10-08 03:28
Thanks. Just to tell you guys the book is called C++ Second Edition By Kris Jamsa Ph.D.





hellboundhackers.org/sig/r/3880.png

Edited by interslice on 09-10-08 03:36
Author

RE: Just starting C++

shadowls
You Like this!



Posts: 840
Location:
Joined: 07.12.06
Rank:
God
Posted on 09-10-08 03:39
I have also just started c++ and i am using the book called "C++ Programming" by D.S Malik


i have leard a lot from the book so far. for example i have leard how to use if and else statements. i have just started the book and it is working for me. The book has a lot of example and challenges for you to try as you make progress. I highly recommend this book.


If you think my post are useful to you, please vote for them. Thank You


knowledge is powerful itself - SHADOWLS


i41.tinypic.com/mjwz7t.jpg

Made by:agentmax69, but remastered by: KvK


Coffee
None None
Author

RE: Just starting C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 09-10-08 03:55
Yeah, pwnzall pretty much summed it up. Don't forget to indent within functions and control statements either, as it will be much easier to read and follow. Also, comments can be a lifesaver, both for yourself and others. You also don't need to specify a namespace, you can just write:

Code

std::cout << "Hello Everyone";





You're probably better off just visiting one of the sites pwnzall posted. That book seems to be using older standards. The cplusplus site has a lot of nice resources and tutorials, so you might want to check it out.
Author

RE: Just starting C++

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 09-10-08 04:06
and if you would like, I have a c++ site that is just getting started. Pwnzall has the first tutorial on the site, and there is a forum that I frequent, So if you have any questions feel free to register and post there.

CTheCode.com


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: Just starting C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 09-10-08 04:15
yours31f wrote:
and if you would like, I have a c++ site that is just getting started.

... Or you could use established resources while that site gets past "getting started". Yay for blatant advertising.

Edit: Glad that post disappeared... I was about to rip into it for very obvious reasons.




Edited by on 09-10-08 04:24
Author

RE: Just starting C++

interslice
Member

Your avatar

Posts: 121
Location: my place of course!
Joined: 05.10.05
Rank:
Newbie
Posted on 09-10-08 05:11
Thanks guys.


hellboundhackers.org/sig/r/3880.png