Jump to content

Need A Program Challenge


Archerzz

Recommended Posts

std::cout <<"Hello World\n";

 

right?

Just wondering, I just began learning C++.  dont bash me for being a n00b.

 

edit: so would this be a valid program?

#include <iostream>

using namespace std;

void didit()
{
    /*std::*/cout <<"I did it\n";
}

main ()
{
     /*std::*/cout <<"Hello World\n";
     didit();
}

508108[/snapback]

 

Un-needed scope operator errors fixed.

Share this post


Link to post
Share on other sites

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

those are unneeded? the book I use has a sentence that says to "just view std::cout as the output function and std::cin as the input command". I was under the impression that you do need it.

 

edit: do you think it is a good start?

Edited by martymcfly

Share this post


Link to post
Share on other sites

those are unneeded?  the book I use has a sentence that says to "just view std::cout as the output function and std::cin as the input command".  I was under the impression that you do need it.

 

edit:  do you think it is a good start?

508127[/snapback]

 

it aint needed because of the "using namespace std;" thing :) If you didn't have that, you'd have to do the whole std::cout blahness...

Share this post


Link to post
Share on other sites

oh! KB added the using namespace thing. This is what happened:

 

KB reads code

notices no using namespace thing

adds

compiles

errors

says I dont need those thing

I did before it was edited

Edited by martymcfly

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...