Author Topic: About using Code Blocks  (Read 2507 times)

jupa

  • Guest
About using Code Blocks
« on: August 03, 2010, 04:06:11 pm »
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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: About using Code Blocks
« Reply #1 on: August 03, 2010, 04:16:27 pm »
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.