r/VisualStudioCode • • Feb 11 '22

Very new at this

Hi everyone,

I've just started the book c language for dummies and I'm trying to convince myself that programming is not out of reach which I starting to believe that maybe it is... Anyway, I use Visual Studio Code for my exercise and I'm now learning about the input and output and the getchar function. When I try to run the program:

#include <stdio.h>

int main() {

int c;

printf("I'm waiting for a character: "); c = getchar(); printf("I waited for the '%c' character.\n",c); return(0);

}

I then get a text file that can't be read and it says: the file is not displayed in the editor because it is either binary or uses an unsupported text encoding. I tried to download the hex editor but from that, I get only the binary (yep). I'm suppose to get a text that says :

I'm waiting for a character: C
I waited for the 'C' character.

Please help a brother that is kind of ridiculing himself in front of the encouragement of its wife.

Cheers!

5 Upvotes

12 comments sorted by

View all comments

Show parent comment

2

u/Postmodern_marxist Feb 12 '22

Very kind words, thanks a lot for your advices.