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?
Page 1 of 1
Guess this ones for you raw
#2
Posted 21 July 2004 - 01:17 PM
Moved to programming forum. tsk tsk
Add this as an include :
#include <netinet/in.h>
Add this as an include :
#include <netinet/in.h>
Lawrence Abrams
Circle BleepingComputer on Google+!
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
How to detect vulnerable programs using Secunia Personal Software Inspector <- Everyone should do this!
Circle BleepingComputer on Google+!
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
How to detect vulnerable programs using Secunia Personal Software Inspector <- Everyone should do this!
#3 Guest_brunt_*
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
Posted 21 July 2004 - 02:45 PM
Yeah anything programming related we want in here.
Did adding that include fix the error?
Did adding that include fix the error?
Lawrence Abrams
Circle BleepingComputer on Google+!
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
How to detect vulnerable programs using Secunia Personal Software Inspector <- Everyone should do this!
Circle BleepingComputer on Google+!
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
How to detect vulnerable programs using Secunia Personal Software Inspector <- Everyone should do this!
#5
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)
struct struct_tag {
data_type1 variable1;
data_type2 variable2;
.
.
}
Remember a structure is an array of variables of different types (int, char, float)
#6 Guest_brunt_*
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>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
Share this topic:
Page 1 of 1

Help
Back to top














