-1

I've been trying to learn C recently. When I execute the following code in visual studio code:

#include <stdio.h>

int main()
{  
    // variable declaration
    int a, b, c;

    // user prompts
    printf("enter a number\n");
    scanf("%d", &a);
    printf("enter another number\n");
    scanf("%d", &b);
    // operation
    c = a + b;
    // printing
    printf("your number is %d", c);

    return 0;
}

it works fine. But I am given this error:

cannot open source file "stdio.h"

I have properly installed gcc, msys, etc. yet any and all #include header lines give the same error. Here is a image of the error (indent rainbow, material theme, C/C++ and error lens extensions): error image link

Pablo
  • 13,271
  • 4
  • 39
  • 59
  • Not a duplicate question but it might be the same problem: https://stackoverflow.com/q/37522462/583044 – tinman Jun 15 '22 at 17:19
  • 3
    *it works fine. but I am given this error:* - it can't "work fine" if it is really can't open the file. Please show the whole compiler output. – Eugene Sh. Jun 15 '22 at 17:25

1 Answers1

0

By "It Works fine" I'm assuming that it compiles, If you have installed C/C++ Extensions Pack for VSCode it might need to configure the Include path

Please, take a look at configuration Example