C++ Problem - Passing Parameters

K thanks. Stupid computer.

Oh yeah, for reference:

cworking.jpg




Hooray! :D
 
Pho said:
Code:
<?php
$variable = "It's ";
$variable .= " much easier to add text to PHP variables";
?>

Code:
string variable="It's";
variable += " not so hard in C++ either";

badgermonkey - your original code was almost 100% C, so yes your lecturer is not teaching you good C++, or even good C, just a mix of both. Explains your surprise with string, namespaces etc..

for some structured learning check out:
Accelerated C++: Practical Programming by Example
by Andrew Koenig and Barbara Moo.
 
FerretBoy said:
Code:
string variable="It's";
variable += " not so hard in C++ either";

badgermonkey - your original code was almost 100% C, so yes your lecturer is not teaching you good C++, or even good C, just a mix of both. Explains your surprise with string, namespaces etc..

for some structured learning check out:
Accelerated C++: Practical Programming by Example
by Andrew Koenig and Barbara Moo.


I'll have to look at that then, thanks :)

(At the moment the 2 books i have are C++ for Dummies and Teach yourself C++ in 21 days. Haven't really loked at them though)
 
FerretBoy said:
Code:
string variable="It's";
variable += " not so hard in C++ either";

That's true, but you often have to use chars for most inbuilt functions, with pointers and all that :).
 
Hardly what an experienced programmer would do, but why don't you just make your array global (i.e. declared outside the scope of all your functions). I base this suggestion on the fact that you've declared your structure globally and I also get the impression that your lecturer may have intended for you to do this as well - I imagine he's not even trying to get you using pointers and so on yet?
 
phykell said:
Hardly what an experienced programmer would do, but why don't you just make your array global (i.e. declared outside the scope of all your functions). I base this suggestion on the fact that you've declared your structure globally and I also get the impression that your lecturer may have intended for you to do this as well - I imagine he's not even trying to get you using pointers and so on yet?


We've been told structures must be global (fow now anyway). Also been told that we will be shot if we use global arrays or variables. :(


Starting a proper look at classes and objects now... let's see him teach us basic C for that! :p
 
Tell him that an important part of any software project is to get the requirements right so if he has specific requirements they should be in the "mission statement" :)
 
Back
Top Bottom