Can anyone help?! I'm new to C and i'm just trying this exercise, and it says there's an error

Updated post! so now i’ve only changed the comma.

#include <stdio.h>
int main() {
    int a, b;
    printf("Enter two numbers:");
// Here's the supposed error.
//It says  “format ‘%d’ expects a matching ‘int *’ argument [-Wformat=]” //
    scanf("%d %d", &a, &b);
//Ends here. The rest is apperantly okay//
    printf("\nSum:%d", a+b);
    return 0;
    }

Woops… All arguments must be comma separated.

This thinks that you are trying to bitwise and the pointer to a and the value of b.

1 Like

Thanks for replying!
I’ve changed that and now it works. It gives me a warning tho : “format ‘%d’ expects a matching ‘int *’ argument [-Wformat=]” . And it still marks the same place as being the problem…

I think you need to post your updated code here so we can see what you did.

img… apperantly everything in the code is alright, i just dont know how to use the programme so i got other that im more familiarized with and it worked…
thx everyone :sweat_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.