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.

Guess this ones for you raw


  • Please log in to reply
5 replies to this topic

#1 Guest_brunt_*

Guest_brunt_*

  • Guests
  • OFFLINE
  •  

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?

BC AdBot (Login to Remove)

 


#2 Grinler

Grinler

    Lawrence Abrams


  • Admin
  • 43,659 posts
  • ONLINE
  •  
  • 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_*

Guest_brunt_*

  • Guests
  • OFFLINE
  •  

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 Grinler

Grinler

    Lawrence Abrams


  • Admin
  • 43,659 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:03:09 PM

Posted 21 July 2004 - 02:45 PM

Yeah anything programming related we want in here.

Did adding that include fix the error?

#5 raw

raw

    Bleeping Hacker


  • Members
  • 2,577 posts
  • OFFLINE
  •  
  • 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)

rawsig.png

 rawcreations.net          @raw_creations


Current systems: WHAT OS, BackTrack-raw, PCLinuxOS, Peppermint OS 6, Kali Linux

and a custom Linux From Scratch server hosting a bunch of top secret stuff.


#6 Guest_brunt_*

Guest_brunt_*

  • Guests
  • OFFLINE
  •  

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>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users