User forums > Using Code::Blocks

About using Code Blocks

(1/1)

jupa:
Hi!

I have the next program to execute and compile but my problem is that I'm using C but some extensions of C++ like functions cout and cin.

#include <stdio.h>
int main ()
{
int n;
cout <<"Ingrese un entero:";
scanf (ā€œ%dā€, &n);
cout << "Entero ingresado:" << n << endl;
return 0;
}

And I don't know why when I try to compile it the compiler display errors of compilation.
Perhaps I forgot some confugurations...

I aprecciate some help

Thank's

Jenna:
Make sure the file is named *.cpp, so C::B knows it's a c++-file and uses the correct compiler.

There are several other things missing from your source and it will not compile (even not with a c++-compiler), but that is basic c++-stuff and questions like this are not allowed in our forum/on our website.

Please read a good book about beginners programming in c++ (or a tutorial) or ask in a c++-forum.

Otherwise you violate our forum rules and your topic will most likely become locked.

Navigation

[0] Message Index

Go to full version