r/VisualStudioCode • u/Postmodern_marxist • 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!
View all comments
Show parent comment
1
u/smokingkrills Feb 12 '22
C is indeed sort of a base language in the sense that it is doesn't have many of the features that make Python (and other high-level languages) easier to learn. When writing C programs you need to understand what is going on at the hardware level.
Python is interpreted, do you don't need to run your programs through the compiler first, and it also deals with memory management for you so you don't have to concern yourself with the hardware as much. Python also has a more intuitive syntax, and more books/tutorials/etc aimed at beginners, so you will have more options for ways to learn.
Which language is best to start with really depends on your goals. I think that if you want to learn web development, JavaScript might be your best bet, if you're interested in doing data science Python is best, and if you're interested in embedded systems that C might be a good first choice.