BleepingComputer.com: Guess this ones for you raw

Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Guess this ones for you raw

#1 Guest_brunt_*

  • Group: Guests

Posted 21 July 2004 - 11:02 AM

when i write a socket program to connect to a server its giving an error in line "struct sockaddr_in addr".

the error is "storage size of 'addr' isnt known"

earlier i used to do programs in c with structures but i dint come across this kind of error. ANy suggestions?

#2 User is offline   Grinler 

  • Bleep Bleep!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Admin
  • Posts: 36,174
  • Joined: 24-January 04
  • Gender:Male
  • Location:USA

Posted 21 July 2004 - 01:17 PM

Moved to programming forum. tsk tsk

Add this as an include :

#include <netinet/in.h>

#3 Guest_brunt_*

  • Group: Guests

Posted 21 July 2004 - 01:33 PM

sorry about that figured I should put this in linux. It's for SuSe not for windows. Again will keep it in mind next time.

#4 User is offline   Grinler 

  • Bleep Bleep!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Admin
  • Posts: 36,174
  • Joined: 24-January 04
  • Gender:Male
  • Location:USA

Posted 21 July 2004 - 02:45 PM

Yeah anything programming related we want in here.

Did adding that include fix the error?

#5 User is offline   raw 

  • Bleeping Hacker
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,294
  • Joined: 14-April 04
  • Gender:Male
  • Location:Texas

Posted 21 July 2004 - 03:02 PM

Well from what you gave me your structure is not correct

struct struct_tag {
data_type1 variable1;
data_type2 variable2;
.
.
}
Remember a structure is an array of variables of different types (int, char, float)
Posted Image
Posted ImageHOSTFix only works on XP,no longer maintained

#6 Guest_brunt_*

  • Group: Guests

Posted 21 July 2004 - 05:22 PM

Thanks Guy's SOrta Figured it out. Yes Grinler It helped Heres what I had to input

#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users