0
#include <stdio.h>
#include <cs50.h>

int main(void)
{
    printf("Give me a number between 1 and 10");
    int n= get_int;

    if (n>=0 && n<=3)
    {
        printf("You picked small one");
    }

    else if (n>=4 && n<=6)
    printf("You picked midium");

    else if (n>=7 && n<=10)
    printf("You picked large");

    else
    printf("I`m a little stupid. Give me positive integer number between 1 and 10");
}

~/workspace/probe/ $ make nonswitch
clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow    nonswitch.c  -lcrypt -lcs50 -lm -o nonswitch
nonswitch.c:7:9: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'int (const string, ...)' (aka 'int (char *const, ...)') [-Werror,-Wint-conversion]
    int n= get_int;
        ^  ~~~~~~~
1 error generated.

1 Answer 1

1
 int n= get_int;

I suppose you want:

int n = get_int();
1
  • thanks man 4321
    – HerrIves
    Commented Feb 4, 2019 at 3:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .