Anyone any good at C++? Created 17 years ago2007-02-12 13:19:33 UTC by Tetsu0 Tetsu0

Created 17 years ago2007-02-12 13:19:33 UTC by Tetsu0 Tetsu0

Posted 17 years ago2007-02-12 13:19:33 UTC Post #212257
I got a killer assignment due and i cant gifure it out.
I'm not asking for someone to complete it FOR me, but i just dont understand strings and output/input files...

anyone know anything about it?
Tetsu0 Tetsu0Positive Chaos
Posted 17 years ago2007-02-12 14:11:00 UTC Post #212270
If it's your assignment, you should do it yourself, and not cheat by asking other people to do it for you. :roll:
m0p m0pIllogical.
Posted 17 years ago2007-02-12 14:13:51 UTC Post #212271
He's not? :P

He wants someone to explain strings and output/input files..
Posted 17 years ago2007-02-12 15:01:21 UTC Post #212280
yea because my professor is a retard and im not buying the $130 book for the class... i found this internet c++ site but it's not proving to be so helpful.. damnit
Tetsu0 Tetsu0Positive Chaos
Posted 17 years ago2007-02-12 15:10:00 UTC Post #212285
Posted 17 years ago2007-02-12 15:41:01 UTC Post #212288
dude.. Buy the book, you can always sell it back later. Your book would be the place to look to explain such things. If you didn't know anything about input/output (cout and cin?) and strings (multi-character non-numeric data?) then... I think you should devote some time with the professor off-class hours, since these are really just the basics. Also I doubt your professor is a retard, its hard to teach a programming language, since things become second-nature once you have experience with a language, and it is hard to translate this knowlege into terms a noobie can understand. Eventually this stuff will just click with you.. (I had trouble when I first started C++ too, it gets overwhelming.)
I dont claim to be a pro with C++, but I know enough about input/output and strings, if you would like some help. Try IRC, it will be simpler than bantering back and forth on the forums.
Posted 17 years ago2007-02-12 15:44:21 UTC Post #212289
I'm sure the local library will have a copy of the book that you can borrow
Posted 17 years ago2007-02-12 16:44:15 UTC Post #212293
Posted 17 years ago2007-02-13 04:57:28 UTC Post #212350
whatever :|
Tetsu0 Tetsu0Positive Chaos
Posted 17 years ago2007-02-13 07:41:37 UTC Post #212359
$130 for a C++ book? I'm sure you could find a cheaper one.
Seventh-Monkey Seventh-MonkeyPretty nifty
Posted 17 years ago2007-02-13 10:35:26 UTC Post #212368
Posted 17 years ago2007-02-13 11:01:04 UTC Post #212372
i wasn't whatevering to you, orph, thank you for the link, i did check it out.. i was whatevering to the fact that it IS my assignment and i AM responsible for it. i have another 13 days, so i'lll use that time wisely and try to learn for myself..

but i seriously think my teacher... is retarded tho.
Tetsu0 Tetsu0Positive Chaos
Posted 17 years ago2007-02-13 11:05:22 UTC Post #212375
Lol, you can't learn C++ in 13 days. All those books with titles like "Learn C++ in # days!" is total bullshit. It takes years to learn.

:r
The Mad Carrot The Mad CarrotMad Carrot
Posted 17 years ago2007-02-13 11:16:05 UTC Post #212378
Posted 17 years ago2007-02-13 16:49:07 UTC Post #212386
im not trying to fully code in 13 days muzz, lol. i just need to know about the string command and such.

All the teacher does in class, is put up the command prompt and fool around with like.. couts and loops.

which i FULLY understand

if elses im fine with
while's im fine with

but strings.. wtf

and 'retarded' is exadderating, sorry for even saying that. im just having a bad week all together.

i set up a meeting with him an hour ago so im gettin some 1 on 1 stuff :x
better be worth it
Tetsu0 Tetsu0Positive Chaos
Posted 17 years ago2007-02-13 18:39:50 UTC Post #212395
Strings as in what? Declaring one and printing it with cout? Simple:

char szMyString[] = "Woo, this is my string.";

It's just an array of character variables. If you don't specify how many characters the array can hold (like shown above), the compiler will automatically add the null '' terminator to the end of your array, which tells the program that the string is finished. Look in string.h (I'm assuming you're using MSVC) to see the different string functions (strcpy, strcmp, etc).

By the way, I highly recommend that torrent that Orph posted. It's got some really good stuff in there.

EDIT: Google is your friend. :D
Posted 17 years ago2007-02-13 19:31:41 UTC Post #212397
If you wanna learn C++ properly, I recommend you avoid using MSVC++, grab a Unix-like OS (FreeBSD, GNU/Linux, GNU/Hurd, or even Mac OS X) and start developing on that.

As for strings (make sure you have included the strings header which should be done with "#include <strings>", at least with glibc):
string a("omfg");
string b("lol");

cout << a << b << "n";
I'm not great with C++, or any language with that matter, but this is some seriously easy stuff -_-

EDIT: Just forgot, don't bother using endl everywhere, despite how neat it looks. It'll slow you down when you end up using it 1,000,000 times, as each time you use endl not only will it produce a linebreak, but also flush the stream. -.O
m0p m0pIllogical.
Posted 17 years ago2007-02-20 16:38:40 UTC Post #213168
If you need help with C++ or Java, I'm doing IT classes at school which are teaching me just this. Just ask. :)
You must be logged in to post a response.