warning: passing arg 1 of `inet_addr' makes pointer from integer without a cast
I use solaris10,following is tcp client code:
when I compile it,it raise following warning:
$gcc -lsocket -lnsl tcpclient.c -o tcpclient
tcpclient.c: In function `main':
tcpclient.c:12: warning: passing arg 1 of `inet_addr' makes pointer from integer without a cast
When I execute it,it raise following error:
$tcpserver &
$tcpclient 127.0.0.1
Segmentation Fault (core dumped)
How to correct above error? How to modify "tcpclient.c:12: warning: passing arg 1 of `inet_addr' makes pointer from integer without a cast"?
You've defined argv as an array of characters, rather than an array of character arrays (i.e. strings). Change your 'main' function definition to this (note the asterisk):
Hi all, I'm new programming in C, so I had the next message in my code:
Dual.c:88:20: warning: pointer type mismatch in conditional expression : &clientSa.sin6.sin6.sin6_addr,
Any help would be great
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include... (1 Reply)
$ cc Array.c
Array.c: In function ‘main’:
Array.c:23: warning: passing argument 1 of ‘scanf’ makes po
Array.c:25: error: expected expression before ‘return’
Array.c:29: error: expected expression before ‘return’
Array.c: At top level:
Array.c:44: error: expected ‘)’ before ‘&’ token... (8 Replies)
I'm trying to write a programme which scans strings to find how many vowels they contain. I get an error saying that I'm trying to compare a pointer and an integer inif(*v == scanme){. How can I overcome this ? Also, the programme seems to scan only the first word of a string e.g.: if I type "abc... (1 Reply)
Hi guys :D
I am still playing with my C handbook and yes, as you can see I have small problem as always :cool:
I wrote a C code
#include <stdio.h> #define MESSAGE 100 int main(void) { char input_mes - Pastebin.com
And when I try to compile it I get following errors from gcc
... (1 Reply)
Hi,
I'm writing a shell script where I need to parse the command line arguments using "getopts" command. While using getopts I need to know how to pass numeral values to getopts. For example:
while getopts ":h" Option
do
case $Option in
h ) display_help;;
... (5 Replies)
A question to ask.
seq1 = "eeeeeeeeeeeeeeeeee";
seq2 = "dddddddddddddddddddd";
char a = '*';
strcat(*seq2, &a);
strcat(*seq1, seq2);
compilation
warning: passing arg 1 of `strcat' makes pointer from integer without a cast
thanks (4 Replies)
I received a warning when I tried to compile my program that said:
warning: comparison between pointer and integer
Could you please explain to me what this means, and in what ways I could possibly fix this?
Thanks for your help! (2 Replies)
Hello all
im newbie in unix , as my experiences i passed to the cat utility http prams as args i got :
cat http://localhost:8000/test.php?
szAddress=&szNationalId=&szFirstName=&szLastName=&undefined=undefined&iTargetModule=0&bFullScreen=
and the result is :
2540
3016
2356
2552
... (0 Replies)
I have a class with an integer pointer, which I have not initialized to NULL in the constructor. For example:
class myclass
{
private:
char * name;
int *site;
}
myclass:: myclass(....)
: name(NULL)
{
.....
}
other member function “delete “ the variable before... (2 Replies)