Well, the problem is here:
int port = *argv[2];
because port is an integer but argv[2] is actually a string.
Use atoi():
int port = atoi(argv[2]);
Type: Posts; User: TCL
Well, the problem is here:
int port = *argv[2];
because port is an integer but argv[2] is actually a string.
Use atoi():
int port = atoi(argv[2]);
#include <stdio.h>
int main(void)
{
int i;
printf("enter a number: ");
scanf("%d", &i);
(i%2)&&printf("The number is odd\n");
(!(i%2))&&printf("The number is even\n");
return 0;
}