Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I am using https://godbolt.org/ to compile a simple C++ script but even the simplest
int main()
{
std::cout << "Hello World!" << std::endl;
}
When I click Add new... --> Compiler --> Output I get: Compiler returned: 0
As #Ayxan Haqverdili told me the missing steps are Output... > Run the compiled output
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
This is used here do {....} while(ch!=?.?); what does ch!=?.? mean here can anybody please help with it.
It's a syntax error with both clang and gcc.
#JonathanLeffler is usually right and I think he nailed the root cause. I used to see this when text was being copied from Microsoft Word to the web (lack of transcode from a Windows code page to ascii/utf8?).
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I made a simple c++ program:
#include <iostream>
int main(){
for (int i = 0; i >=; i++){
std::cout << i << "\n";
}
return 0;
}
It compiles but the output .exe doesn't run.
Edit: I used GNAT Studio 2021 compiler.
The termination condition is incorrect : i >=.
You can choose a number of turn of the loop, for exemple 10 with : i<=10.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
the code i wrote
What am i doing wrong in here it gives me an error and its very very basic.
enter code here
# include <iostream>
using namespace std;
int main()
{
string firstone = "giraffe academy";
cout << firstone.substr(8, 3);
return 0;
}
You need to
# include <string>
that defines << for std::string
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I'm building a simple program that manages employee info, but I'm experiencing some weird issue with the cin >> command, because every time I build the project I get one error only for one cin >>.
You forgot a ; on the previous line:
double hourly_wage = 23.50 // <-- ; missing here
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
The code using printf and cout:
int a=0;
a=printf("Hello World");
cout<<" "<<a;
Output :
11Hello World
The code using printf:
int a=0;
a=printf("Hello World");
printf("%d ",a);
Output :
Hello World11
You must have disabled synchronization between std::cout and C API?
If it is enabled I can't reproduced it
If I disable this synchronization I reproduce observed output.
For more information read about std::ios::sync_with_stdio