Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 4th, 2005, 9:49 AM   #11
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
As said for about 1000 times try to not use those old header files...
ivan is offline   Reply With Quote
Old Dec 4th, 2005, 9:55 AM   #12
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
i get undeclared function whenever i leave out the .h

with this simple code for example..
#include <iostream>

int main()
{
    cout << "hello ";
}

ill get this error

Quote:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\jay\Desktop\dg.cpp" -o "C:\Documents and Settings\jay\Desktop\dg.exe" -I"d:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"d:\Dev-Cpp\include\c++\3.4.2\backward" -I"d:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"d:\Dev-Cpp\include\c++\3.4.2" -I"d:\Dev-Cpp\include" -L"d:\Dev-Cpp\lib"
C:\Documents and Settings\jay\Desktop\dg.cpp: In function `int main()':
C:\Documents and Settings\jay\Desktop\dg.cpp:5: error: `cout' undeclared (first use this function)
C:\Documents and Settings\jay\Desktop\dg.cpp:5: error: (Each undeclared identifier is reported only once for each function it appears in.)

Execution terminated
EDIT: well.. someone could have told me "using namespace::std;" always had to be included :o
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old Dec 4th, 2005, 10:01 AM   #13
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
cout is in the std namespace. It's std::cout now. You can leave off the "std::" part by putting:
using std::cout;
at the top of the functions you use it in.

You can also put the using declaration or:
using namespace std;
at the top of your programs (usually underneath your #includes), but this is generally not advisable.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Dec 4th, 2005, 10:02 AM   #14
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,183
Rep Power: 5 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by Symptom
It very common to handle every incoming connection to the server, not in the parent process, but with child processes using
fork();
That way when the client is done with the server, the child process ends and, furthermore, the client is able to handle more than one connections simultaneously.
If you're programming under windows though, I don't know if you have a POSIX-like environment that supports these system calls...
To my knowledge, the gcc/gpp ports to DOS/Win32 don't support fork().

That said, why wouldn't you just use threads, POSIX or otherwise?
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Dec 4th, 2005, 10:15 AM   #15
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
EDIT: well.. someone could have told me "using namespace::std;" always had to be included
You're not reading enough of the threads, or reading them thoroughly enough, at least. You're still misconstruing scads of posts.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC