Hello
I having problem with fd_set pointer.....
1st attempt:
test.h :
test.c :Code:#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <sys/ioctl.h> #include <fcntl.h> #include <sys/time.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <signal.h> #include <netdb.h> #include <ctype.h> void testfdset(fd_set *test) { FD_ZERO((struct fdset) &test); }
Error shown:Code:#include "test.h" int main() { fd_set testing; testfdset(&testing); return 0; }
Code:$ gcc test.c In file included from test.c:1:0: test.h: In function ‘testfdset’: test.h:18:2: error: conversion to non-scalar type requested
2nd attempt
test.h :
test.c :Code:#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <sys/ioctl.h> #include <fcntl.h> #include <sys/time.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <signal.h> #include <netdb.h> #include <ctype.h> void testfdset(fd_set *test) { FD_ZERO((struct fdset *) &test); }
Error shown:Code:#include "test.h" int main() { fd_set testing; testfdset(&testing); return 0; }
Any solution to the pointer or reference problem?Code:$ gcc test.c In file included from test.c:1:0: test.h: In function ‘testfdset’: test.h:18:2: error: dereferencing pointer to incomplete type
Thanks



LinkBack URL
About LinkBacks




