Search:

Type: Posts; User: TCL

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,864

    Well, the problem is here: int port =...

    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]);
  2. Replies
    12
    Views
    2,627

    #include int main(void) { int i; ...

    #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;
    }
Results 1 to 2 of 2