FAQ: Hello World - Output

This community-built FAQ covers the “Output” exercise from the lesson “Hello World!”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn C++

FAQs on the exercise Output

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Quick question, what does the “std” stand for?

if i google:

c++ std

google provides the answer for me:

C++ Standard Library - Wikipedia

without even having to click on it, the link already has the answer in it

1 Like

“std” stands for standard. Hope this was helpful!

I think it is a c++ standard library the replaces the “using the namespace”

When I typed std::cout<<“codecademy\n”; I got the output but not in the case cout<<“codeacademy\n”; … why so??

1 Like

C++ is made up of many libraries. cout belongs to the standard library also referred to as a namespace. cout by itself means nothing. std::cout is referring to cout in the standard namespace. It can get tiring having to type std:: before everything that you want to use from the standard library, so that’s where using statements come in. You probably haven’t gotten to those yet, but in time you will. For now, it’s best to follow the progression of the lessons. Happy coding!

1 Like

this online program that you use to write and run your C+ instractions is programmed to see this word “codecademy” output in the terminal , nothing else ; so it is not related to C++ compiler or not meaning that you have made a mistake

cout will not work without being qualified as an object in the std namespace in one of the following ways:
using declaration:

#include <iostream>
using namespace std;
int main() {
  cout<<"Any text";
}

or explicit qualification:

#include <iostream>
int main() {
  std::cout<<"Any text";
}

Attempting to use cout without qualification will raise an error:
error: 'cout' was not declared in this scope
If you have information to the contrary, please share.

1 Like

Daza007

Hi, why do we have to include wired symbols in any computer languages that we never learnt or heard about this. It really is confusing symbols.

How to write programs in a straightforward instructions with a flow chart as a guide and minimize weird symbols!!!

When typing between the curly braces, does the amount of space between the line of code and the braces matter? In the exercise there are 3 empty lines between { and }. For example

  1. {
  2. (line of code)
  3. }

VS

  1. {
  2. (line of code)
  3. }

only for readability.

1 Like