Download link for a good {free} C++ IDE that runs in Windows7 64bit?

i_hate_toms

New Member
Have some serious OOP things this semester, and desperately need a C++ compiler/ IDE to test the programs I write.
I'd need a ANSI compliant compiler, one where i can use #include<iostream> [NOT forced to use iostream.h], and one that can run in 64bit Windows 7.
Can someone please provide me a link to such an IDE?
Thanks :)
 
Visual C++ 2010 Express will do fine, or you can get mingw32 compiler and either NetBeans/Eclipse as the IDE (both have C++ support), though for just school even a good text editor like Notepad++ might suffice as IDE.

The 2010 version of VC++ doesn't support the most recent (C++11) standard, but it's reasonably compliant with the previous standard and I sincerely doubt you would actually require any C++11 features. Plus, though I do most of my programming on Linux, I have to admit the IDE is superb.

http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express
 
If you have a valid .EDU email address assigned to you, you could sign up for a free Microsoft Dreamspark account. They have Visual Studio available as a free download.
 
thnx both of you :)
got this friend, she has a Visual Studio 6 working model CD.
Will it do? We aren't required to use all the advanced features of ANSI C++. The only thing I need, is to be able to use namespaces, and header files that don't end with *.h

I installed it, seems to be working, but the simplest program i wrote, is giving errors.
here's the program
code.jpg

#include <iostream>
using namespace std;
void main()
{
class person
{
char name[30];
int age;

public:
void getdata(void);
void display(void);
};
void person::getdata(void)
{
cout<<"Enter name: ";
cin>>name;
cout<<"Enter age: ";
cin>>age;
}

void person::display(void)
{
cout<<"\nName: "<<name;
cout<< "\nAge "<<age;
}
int main()
{
person p;
p.getdata();
p.display();
return 0;
}

And this is the message that i get:
--------------------Configuration: hwrld - Win32 Debug--------------------
Compiling...
hwrld.cpp
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(11) : error C2599: 'getdata' : local class member functions must be defined within the class
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(11) : see declaration of 'getdata'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(12) : error C2599: 'display' : local class member functions must be defined within the class
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(12) : see declaration of 'display'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(15) : error C2601: 'getdata' : local function definitions are illegal
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(23) : error C2601: 'display' : local function definitions are illegal
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(28) : error C2556: 'int __cdecl main(void)' : overloaded function differs only by return type from 'void __cdecl main(void)'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(3) : see declaration of 'main'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(28) : error C2371: 'main' : redefinition; different basic types
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(3) : see declaration of 'main'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(28) : error C2601: 'main' : local function definitions are illegal
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\hwrld\hwrld.cpp(34) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

hwrld.exe - 8 error(s), 0 warning(s)

What's up? Something i messed? or problem with the compiler?
I just typed it str8 frm the text book, didn't make it up myself, so i doubt the code is wrong. What's wrong?
Thanks for ur help pals :)
 
Last edited:
Silly me
it should be
#include <iostream>
using namespace std;
class person
{
char name[30];
int age;

public:
void getdata(void);
void display(void);
};
void person::getdata(void)
{
cout<<"Enter name: ";
cin>>name;
cout<<"Enter age: ";
cin>>age;
}

void person::display(void)
{
cout<<"\nName: "<<name;
cout<< "\nAge "<<age;
}
int main()
{
person p;
p.getdata();
p.display();
return 0;
}
i wrote main () twice :P
this is working now. thnx :D
 
I imagine it should do.

As for the errors in your code, you have two main functions; you can only have one (and it should return and int and take an int and an array of char*s as arguments).

Also, when a function takes no arguments, you should just have empty parentheses rather than void; the latter is C style and I don't know if it's even supported in C++, it's certainly not recommended practice.

EDIT: Oh, you fixed it yourself - never mind then :)
 
Got another silly question :P

#include<iostream>
using namespace std;
void main()
{
cout<<(3/2);
}
Why would it print 1, instead of 1.5?
How do i get it to work with floating points??
thnx!!
 
By default, 3 and 2 are treated as integers, so that performs integer division (i.e. the remainder is discarded). To get 1.5, do 3.0/2 - the .0 at the end makes it a double so you'll be doing floating-point division.
 
By default, 3 and 2 are treated as integers, so that performs integer division (i.e. the remainder is discarded). To get 1.5, do 3.0/2 - the .0 at the end makes it a double so you'll be doing floating-point division.
You're right, 3.0 instead of 3 WORKS!!
It does not remove the decimal part if i use 3.0;
Thanks man :) :good:
 
Back
Top