trial

I will try to insert tagged code
Here is the code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!\n";
}
Presumably, you've already realised that it didn't work?
Please tell me how to do. What button shall I hit ? Where is this button. Many thanks I see 12 little on the right side, Is the one "source code" ???
It's the
<>
button. If you hover over each button, a tooltip should appear telling you what the button does.

Alternatively, you can write the tags into your post manually. I posted this link in your other thread, but apparently you didn't read it, so I'll post it again for your enlightenment:

http://www.cplusplus.com/articles/z13hAqkS/
Last edited on
See this article for how to use code tags.
http://www.cplusplus.com/articles/jEywvCM9/

BTW, it's the <> button.

I try again.
Here is the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*carreNombre*/ 
#include <iostream>                                                         using namespace std;
double square(double x)
{
return x*x;
}
void print_square(double x)
{
cout << "the square of " << x << " is " << square(x) << "\n";
}
int main()
{
print_square(1.234);
}                       //end of file 
Line 2: using namespace std; can't be on the same line as a preprocessor directive (#include).

Did you have a question other than how to use code tags?

Topic archived. No new replies allowed.