Thread: Need opinion...
View Single Post
Old Jan 18th, 2005, 4:25 PM   #23
Osiris
Newbie
 
Join Date: Jan 2005
Posts: 2
Rep Power: 0 Osiris is on a distinguished road
/*Making variables is fun
and I will have lots of fun
doing them today! So of with
the show! As a I output stupid
text using fun stuff like
variables!! */
#include <iostream>
using namespace std;

int var_tex_a; //this is a dandy global variable

I really don't know what you were trying to do here, or I have never used external variables before...
int >> var_tex_b; //although somewhat obsolete, in this case, this is and external variable (which doesn't seem to work)
int hello;

int main () //so this should be starting the main function...
{
int stuff; //and this is a local variable

The errors might be between these lines

//because int only accept numbers, assigning strings to it might result in error...
var_tex_a = "pretty images"; //here I assign stuff for the variables...
stuff = "I made this stuff! ";
hello = "HELLO WORLD!"
//and now I shall generate the actions for the program!
The errors might be between these lines

Ok, more errors here too, because the '\n' has to be inside the quotations..
cout << "So this is very hard to do" /n;
cout << "seing that I'm programing for the very first time" /n;
cout << "I can now make a more complex 'Hello world thing'" /n;
cout << "but on with the dandy output:" /n;
cout << ""/;
cout << hello /n:
cout << /t /t stuff endl;

return 0;
}
//which seems not to work... how disapointing!



This is without the errors...
#include  <iostream>
using namespace  std;

int var_tex_a; //these are dandy global variables
int var_tex_b; 
int hello;

int main () //so this should be starting the main function...
{
    int  stuff; //and this is a local variable

    var_tex_a = 1; //here I assign stuff for the variables, and since they are integers, numbers will do...
    stuff = 19;
    hello = 10;
    //and now I shall generate the actions for the program! :D

    cout << "So this is very hard to do \n"
    << "seing that I'm programing for the very first time \n"
    << "I can now make a more complex 'Hello world thing' \n"
    << "but on with the dandy output: \n"
    << "\n"
    << hello << "\n"
    << "\t\t"<< stuff << endl";
    
    return  0;
}

Or if you wanted your program to display the text you specified...

#include  <iostream>
#include  <string>
using namespace  std;

string var_tex_a; //these are dandy global variables
string var_tex_b; 
string hello;
int main () //so this should be starting the main function...
{
    string stuff; //and this is a local variable

    var_tex_a = "pretty images";
    stuff = "i made this stuff";
    hello = "HELLO WORLD";
    //and now I shall generate the actions for the program! :D

    cout << "So this is very hard to do \n"
    << "seing that I'm programing for the very first time \n"
    << "I can now make a more complex 'Hello world thing' \n"
    << "but on with the dandy output: \n"
    << "\n"
    << hello << "\n"
    << "\t\t"<< stuff << endl;
    
    return  0;
}

Quote:
Sorry for bugging you with trivial questions like this one, but I figure I must learn by annoying someone... (you were just unlucky enough to be picked by me).

Just look on the bright side, maybe when I become a super-programmer-type-guy I can help you instead!
No problem, just remember that if you can't find your answer here, there is always google... and I hope I can find you when you become a super-duper-programmer so I can ask you questions.
Osiris is offline   Reply With Quote