Reply: socket question (beginner)
- To: debian-user@lists.debian.org
- Subject: Reply: socket question (beginner)
- From: Sven Gaerner <sgaerner@gmx.net>
- Date: Sun, 15 Oct 2000 11:15:27 +0200
- Message-id: <14825.30127.415950.72159A@insomnia>
- In-reply-to: In your message of "Sun, 15 Oct 2000 00:09:59 -0400" <20001015000959.B815@Rankor.JJLNet>
- References: <20001015000959.B815@Rankor.JJLNet>
You shoud change you declaration from
sockaddr_in s;
to
struct sockaddr_in s;
Sven
>>>>> "Jonathan" == Jonathan Lupa <jjlupa@jamdata.net> writes:
Jonathan> [1 <text/plain; us-ascii (quoted-printable)>] I have
Jonathan> this feeling that I'm going to feel terribly stupid once
Jonathan> someone tells me what I'm doing wrong, but....
Jonathan> ======= #include <sys/types.h> #include <sys/socket.h>
Jonathan> int main( const int argc, const char * argv[] ) {
Jonathan> sockaddr_in s; return 0; } =======
Jonathan> Rankor:~/src/sockets$g++ stupid.cpp stupid.cpp: In
Jonathan> function `int main(int, const char **)': stupid.cpp:6:
Jonathan> `sockaddr_in' undeclared (first use this function)
Jonathan> stupid.cpp:6: (Each undeclared identifier is reported
Jonathan> only once... stupid.cpp:6: parse error before `;'
Jonathan> ======= - sockaddr_in s; + struct sockaddr_in s; =======
Jonathan> Rankor:~/src/sockets$g++ stupid.cpp stupid.cpp: In
Jonathan> function `int main(int, const char **)': stupid.cpp:6:
Jonathan> aggregate `struct sockaddr_in s' has incomplete type and
Jonathan> cannot be initialized ======= Rankor:~/src/sockets$g++
Jonathan> --version 2.95.2
Jonathan> What am I missing?
Jonathan> THANKS!
Jonathan> Jonathan
Jonathan> -- jjlupa@jamdata.net GPG public key available from
Jonathan> http://lupavista.jamdata.net/gpg.asc
Jonathan> ------------------------------------------------------------------
Jonathan> Lament 1750: "If I only had a radioactive decay source
Jonathan> and a fast free-running oscillator..." [2
Jonathan> <application/pgp-signature (7bit)>]
Reply to: