First c plus plus program.

/*
|
| My name is Cai Penghui, I am from
| China. This is the first time I learn
| cplusplus, and this is my first entry
| program. Welcome to help me find out
| what the problem is, and help me to
| modify. Thank you very much! I do not
| have Twitter and face book. Because
| our country can not use these
| software. You can send me an email.
| 2473779815@qq.com
*\
#include<iostream>
#include<cfloat>
int main()
{
double c = 3.214;
std::cout<<"c"= <<c;
std::endl;
return 0;
}
Last edited on
std::cout<<"c"=<<c;std::endl;

should be

std::cout << "c =" <<c << std::endl;
Last edited on
In C++, every statement is terminated with a semicolon.

double c = 3.214;
Do not edit the code in your first post. It makes people's comments meaningless and makes the thread hard to follow.

Anyway,
1
2
std::cout<<"c"= <<c;
std::endl;

is still wrong. I already wrote the correct line:
std::cout << "c =" <<c << std::endl

Edit: Edited to put quote in right place. Thanks, MB.
Last edited on
std::cout<<"c"= <<c;

I assume the '=' sign is supposed to be part of the text output, so this should be:

std::cout << "c=" << c;
Nuts. Yes, that too. That'll teach me! The point I meant to make with that was that the std::endl is something fed to the std::cout using the << operator ; should have paid more attention to the code!

I see we've all been reported. OP throwing a tantrum, or some other joker?
I'm just a beginner. We are not the same time with you in China ah. We are in the evening, you morning. I'm tired now There may be a problem with the double definition.
https://ideone.com/yPVhBz

There's your working version
O(∩_∩)O



I see we've all been reported. OP throwing a tantrum, or some other joker?

Probably some troll. It happens from time to time.
Topic archived. No new replies allowed.