main is nothing else than any other function, except for being the starting and mostly ending one, the Big Boss if you want...
if you use void it means the function won't return a value. He used int because it would require too much time for one video to explain what arguments are when you start a program...
1. scanf is used for reading the input from the user until he presses ENTER. It is much better to use getchar to record ONE character from the user and put it into a CHAR variable instead of recording an unlimited user input and hoping he doesn't input more than one character. Because if he does do so and put a whole string in a char, it will break the program...
2.scanf is considered "unsafe" because it can sometimes produce unexpected results
Thanks I've learnt so much off of these tutorials I'm 13 and an aspiring games programmer so I have been learning C this has taught me soo much, shame you have stopped making them
I'm just a little confused. I was always taught to get my consoles to stay open with the system("PAUSE"); command and that just seems to be a little better programming practice. What's the difference?
@TheNanoStuff system(PAUSE) is an actual call to an underlying OS function, whereas getchar() is a stdio C function...getchar is just lighter and more portable...A lot of people will do something like:
@jptbaba Hi, getchar is good, but would be better to teach how to clean the the buffer instead of sloopy code... So it would be more like scanf(" %c", &gender); and i meant to use the space b4 the %c which clears the buffer... scanf also reads all types which will be more usefull in a long run...
@jptbaba Another thing is, you should be returning 0 at the end of the main function to tell the operating system the program terminated correctly... C also has no "real" strings. And pointers should be better explained since they are crucial to the language. They are also more advance subjects of the language for someone who is just starting to learn the language.. Also the tutor is making no use of Warnings on the compiler which starts terrible practice. Learning how to stop errors is a must.
@stardevelin Oh I get it. Actually I have been self-learning those language, and I am beginning to understand how C converts to ASM now. Thanks for the information. Though self-learning may take lot of time, it rely benefits a lot!
im glad your actually doing little typo's,i do this as i follow the video and i think to myself shouldnt there be a .... there?helps me memorise it better
THANK YOU SO MUCH Mister! I use to think programming is hard and really complicated. But now after i watched these C++ programming videos i could make programs like these! (I only create small programs like this) Thanks to you, i could make my dreams as a video game programmer come true!
@mrlogan1144 ..Invalid initializer errors refer to the fact that an initializer must be resolved at compile time. So you might be trying to initialize something within a function call, that causes the error.
@saddamsmadame On your keyboard next to the P key theres the {[ and ]} the french bracket is {} just hold shift and push the {[ or ]} key, hope this makes sense,,
@wilc3685 You mean "car", and yes some people do pronounce it as "char", short for "CHARacter". However, I have never heard it pronounced as "care" before.
for some reason it dosnt terminate the program when i press a random button it just writes it in the console... and thats before i did the getchar stuff it also happend in the last tutorials
If ur having any trouble with this stuff just sign up to : programminghelper.webs.com : the site offers completly free help. FREE signup. FREE tutorials. FREE videos
@MrCheeseILike really? # has always been called pound. Ever notice when your on the phone with a machine and it asks you to enter a "password" or something "followed by the pound key"?
@MrCheeseILike i see you are in the UK so that might have something to do with it. they may not call it "pound" there as the pound is your countries currency.
@littlec916 no i think its just america being the odd one out... its a hash at least in singapore, australia, nz, canada, kuwait, uk places i have worked...
anyone please give the link for next video in this series??
prakharjavre 4 weeks ago
5 people are transgenders!
93thematter 1 month ago
why use int main ( ) instead of void main ( ) ? =)
jemgaleon 1 month ago
@jemgaleon
main is nothing else than any other function, except for being the starting and mostly ending one, the Big Boss if you want...
if you use void it means the function won't return a value. He used int because it would require too much time for one video to explain what arguments are when you start a program...
ManijakTotalni 1 month ago
Comment removed
jemgaleon 1 month ago
Why you don't use scanf instead of getchar? :O
igli2pac 1 month ago
@igli2pac
1. scanf is used for reading the input from the user until he presses ENTER. It is much better to use getchar to record ONE character from the user and put it into a CHAR variable instead of recording an unlimited user input and hoping he doesn't input more than one character. Because if he does do so and put a whole string in a char, it will break the program...
2.scanf is considered "unsafe" because it can sometimes produce unexpected results
ManijakTotalni 1 month ago
Thanks I've learnt so much off of these tutorials I'm 13 and an aspiring games programmer so I have been learning C this has taught me soo much, shame you have stopped making them
97epicman 2 months ago
Thanks I've learnt son
97epicman 2 months ago
>Reads tutorial for an hour. Learns nothing.
>Watches few tutorials. Learns more than I could've learned from a day of reading that tutorial.
In all, Great tutorial.
TheFancyChair 2 months ago
I'm just a little confused. I was always taught to get my consoles to stay open with the system("PAUSE"); command and that just seems to be a little better programming practice. What's the difference?
TheNanoStuff 2 months ago
@TheNanoStuff system(PAUSE) is an actual call to an underlying OS function, whereas getchar() is a stdio C function...getchar is just lighter and more portable...A lot of people will do something like:
printf("Press any key to continue. . .");
getchar();
kelketamine 2 months ago
@TheNanoStuff for more info (and a better explanation xD) gidnetwork (dot) com (slash) b-61 (dot) html
(why u no let us post links utoob)
kelketamine 2 months ago
i luv u
Tomdapoppadom4573 2 months ago
great vids!
Thet3 3 months ago in playlist More videos from LearnToProgramDotTV
Unfortunately no more C tutorials..
Many efforts from Indians but I cannot understand the..
Eptapus 3 months ago in playlist C PROGRAMMING
4 people fail at c
DaGamingW0lf 4 months ago 14
It works perfect for me..
MrBikerking200 4 months ago
Can't make run everytime i try it says [Linker error] undefined reference to `Printf' ld returned 1 exit status, help me please
alireza1341 4 months ago
@alireza1341 Hi, C is a case sensitive language, so you can't use Printf.. The function is printf(" ");
stardevelin 3 months ago
Can't make it work it says [Linker error] undefined reference to `Printf' ld returned 1 exit status
alireza1341 4 months ago
Those disliking are the either half brained or wise persons.
So I ask you wise persons only, what flaw did you find with the tutorial
jptbaba 5 months ago
@jptbaba Hi, getchar is good, but would be better to teach how to clean the the buffer instead of sloopy code... So it would be more like scanf(" %c", &gender); and i meant to use the space b4 the %c which clears the buffer... scanf also reads all types which will be more usefull in a long run...
stardevelin 3 months ago
@jptbaba Another thing is, you should be returning 0 at the end of the main function to tell the operating system the program terminated correctly... C also has no "real" strings. And pointers should be better explained since they are crucial to the language. They are also more advance subjects of the language for someone who is just starting to learn the language.. Also the tutor is making no use of Warnings on the compiler which starts terrible practice. Learning how to stop errors is a must.
stardevelin 3 months ago
@stardevelin Oh I get it. Actually I have been self-learning those language, and I am beginning to understand how C converts to ASM now. Thanks for the information. Though self-learning may take lot of time, it rely benefits a lot!
jptbaba 3 months ago
im glad your actually doing little typo's,i do this as i follow the video and i think to myself shouldnt there be a .... there?helps me memorise it better
Jmoebyte 6 months ago
u rock dude :)
ImJunad 6 months ago
@DATHURRDURR Yeah i have the same problem
TheJunkProductionz 7 months ago
THANK YOU SO MUCH Mister! I use to think programming is hard and really complicated. But now after i watched these C++ programming videos i could make programs like these! (I only create small programs like this) Thanks to you, i could make my dreams as a video game programmer come true!
MrAgySiahaan1 8 months ago
@MrAgySiahaan1 LOL for your information this is not C++, this is C
jptbaba 5 months ago
i AM currently 2 years a head of all my class and year because of some of theese vids i am 13
walbottlehacker1234 8 months ago
i AM currentl 2 years a head of all my class and year because of some of theese vids i am 13
walbottlehacker1234 8 months ago
i am 2 years ahead of my school work because of some of theese videos
walbottlehacker1234 8 months ago
char name[10] = {\0}
Help!! i don't have the missing icons on my keyboard! :S
1337varlor 8 months ago
umm it's telling me Id returned 1 exit status permission denied
Fartnarg 9 months ago
is this really c? or c++ because i haven't learn to use getchar yet, i normally use scanf, please tell me the difference
k1ller2one 10 months ago
Have you uploaded part 2 to this video yet?
CrestofLoki 11 months ago
how do u put the numbers
12blaki12 11 months ago
is the c programming donesnt use any database?? 9im new in c prgramming)
Kyuoera 1 year ago
What if you have multiple characters that you want to use? Please answer back.
thaoxiong1 1 year ago
Good tutorial but to learn in-depth I recommend cs50.net. Theses courses are from Harvard university.
Cs50.net
Jugdesi 1 year ago
On the third source file you made(string 3.c) I can't seem to see what I did wrong. I copied everything you did. Please help, thanks.
mrlogan1144 1 year ago
Very helpful tutorials, but I have a problem. When I type in the command it says on line 5 invalid initializer, what should I do to fix it? Thanks.
mrlogan1144 1 year ago
@mrlogan1144 ..Invalid initializer errors refer to the fact that an initializer must be resolved at compile time. So you might be trying to initialize something within a function call, that causes the error.
Theowne 1 year ago
Hm im getting the two errors ''in function: main'' and ''syntax error before printf'' can any1 help me?
sshadowdie 1 year ago
Nice to see that you are using a larger font for this toturial.
Thanks :)
happygamestvfun1 1 year ago
Thank you so much for uploading these tutorials.
qtypnay 1 year ago
how do u type the french brackets?
saddamsmadame 1 year ago
@saddamsmadame On your keyboard next to the P key theres the {[ and ]} the french bracket is {} just hold shift and push the {[ or ]} key, hope this makes sense,,
FloppyEmperor 1 year ago
When is the next program? i want to learn more. i am planning on going back to school i want to know something then nothing.
Booboo201999a 1 year ago
I'm new at this but what is stdio.h is it the same as iostream ?
PoizonFart 1 year ago
@PoizonFart
Stdia.h is the stand input an put port library in C program.
Iostream is the stander C libraries.
Booboo201999a 1 year ago
char is pronounced "care" not "char."
wilc3685 1 year ago
@wilc3685 maybe hes dutch or something.
PoizonFart 1 year ago
@wilc3685 You mean "car", and yes some people do pronounce it as "char", short for "CHARacter". However, I have never heard it pronounced as "care" before.
Thank-you for you're comment.
happygamestvfun1 1 year ago
I learned a lot from this video. Keep it up! XD
watashame2 1 year ago
What's Wrong With This Code?
printf("You Selected:%c", gender );
122445566 1 year ago
hello , so first thank youuu for the vids , but i have a question , what is the diffrence betewene getch and getchar , ???? and thenks again
viveyutub14 1 year ago
for some reason it dosnt terminate the program when i press a random button it just writes it in the console... and thats before i did the getchar stuff it also happend in the last tutorials
Kav2990 1 year ago
I'm learning alot.. this is way better than in school :]
rotfarm 1 year ago 75
@rotfarm i know!! stupid system doesn´t work!!
Pan0621 10 months ago
why did you use %c on the first one then %s
sam421kc 1 year ago
@sam421kc %c is for character and %s is for string
chinkifymecaptain 1 year ago
@chinkifymecaptain oh thanks
sam421kc 1 year ago
What does Int mean?
leshkaka 1 year ago
@leshkaka
int = integer
integer = any whole number negative or positive
hope it helped
lokie032269 1 year ago
Instead of hitting M or F, hit Enter and then it gets all glitched =P.
crazynoob11 1 year ago
@crazynoob11 then write one more getchar(); it worked for me...
VincentVBoold 1 year ago
Hey guys,
If ur having any trouble with this stuff just sign up to : programminghelper.webs.com : the site offers completly free help. FREE signup. FREE tutorials. FREE videos
ComputerGeek3334 1 year ago
@icebreakerclanleader did it report any build errors?
deafencryption 1 year ago
@icebreakerclanleader try the getchar(); command
deafencryption 1 year ago
Since when was # the pound symbol?!?
MrCheeseILike 1 year ago
@MrCheeseILike really? # has always been called pound. Ever notice when your on the phone with a machine and it asks you to enter a "password" or something "followed by the pound key"?
littlec916 1 year ago
@MrCheeseILike i see you are in the UK so that might have something to do with it. they may not call it "pound" there as the pound is your countries currency.
littlec916 1 year ago
@littlec916 yes i agree, here in the UK we call it the 'hash' symbol i think
MrCheeseILike 1 year ago
@littlec916 no i think its just america being the odd one out... its a hash at least in singapore, australia, nz, canada, kuwait, uk places i have worked...
ajjbennett 1 year ago
@ajjbennett and India
god4506 1 year ago
@MrCheeseILike Since America gave it that name
MrNukesftw 1 year ago
thanks, this helped a lot, you have the best Dev C++ tutorial on youtube.
Gutsyndicate 1 year ago
@DJLava90 just line numbers for the code
nerdydev 1 year ago
How do i change my font size and style? please reply fast...
shauziful 1 year ago
@shauziful USE VISUAL C++!!!!! Everyone!
FOOFlGHTERS 1 year ago
@PS3Films133T It can be incorperated into programs as a scripting language. Good for games.
0121ryanh117 2 years ago
is it different complier from turbo c/c++ by borland?? with background color blue???
that the compiler that i have ??
johnpatrickr04 2 years ago
Great tutorial :). Btw, what font are you using? Looks great.
KIFulgore 2 years ago
the black window wont pop up again omg why X (
Z3ROProductionZ 2 years ago
thx, very helpful
JoHolz 2 years ago
Great tutorial, helps me a lot!
bry1500 2 years ago