943,907 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 4038
  • C++ RSS
Sep 13th, 2003
0

c++ compiling problem

Expand Post »
Hi again.Read the source code below please:
// Determining the size of variable types

#include <iostream.h>

int main()
{
cout << " The size of a bool is:\t\t" << sizeof(bool) << " bytes.\n";

return 0;
}

p:s:I have not included the other variable types because there was no error message for them.The error message says the bool is an undeclared identifier.c++7,or c700.that's what my cd says!I don't know how to write my code in notepad and then transfer my file from notepad to the compiler to link.I have Borland Turbo C++ Version5.02 in that cd.Should I try to install turbo c++ and then try to use the borland compiler for my c++ codes? I don't know but how is it possible to use other compilers except than the default one I use with c++?
Similar Threads
Reputation Points: 16
Solved Threads: 2
Posting Whiz in Training
camelNotation is offline Offline
208 posts
since Sep 2003
Sep 13th, 2003
0

Re: c++ compiling problem

I just compiled your program with gcc on my linux machine, and it told me that a bool is one byte. Sorry, I have no recent experience with Borland's compiler tools - the last time I used Turbo C++ 4.5 I was back in 10th grade.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Sep 13th, 2003
0

Re: c++ compiling problem

Also, use <iostream> instead of <iostream.h>
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Sep 13th, 2003
0

Re: c++ compiling problem

Sorry, I missed your P.S. Well, you're using an IDE, integrated development environment, which means that your editor and compiler are built into one. If you have Microsoft Visual C++ 6 or Visual C++.NET handy, you can try the compiler built into that IDE.

I just tried the gcc compiler on linux and it worked (as I noted already).
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Sep 13th, 2003
0

Re: c++ compiling problem

i see.thankx.Does that mean I can write my source codes,following my c++ syntax in .net compilers?great...
Reputation Points: 16
Solved Threads: 2
Posting Whiz in Training
camelNotation is offline Offline
208 posts
since Sep 2003
Sep 13th, 2003
0

Re: c++ compiling problem

If you have C++.NET, you can compile in that. However, there are some differences depending on what platform you're programming for. C++.NET has a lot of proprietary built-in functions, for example.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Im new to this site and c++
Next Thread in C++ Forum Timeline: Great problem in VC++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC