How do I handle key presses and key up events in the windows message loop? I need to be able to call two functions OnKeyUp (char c); and OnKeyDown (char c);???
umm..when you made the character for your last name at 5:56. You created 10 elements but 'Lassoff' only contains 6 elements. What happens to other elements left? Thanks!
does defining the character length with [10] give the max amount of characters you can use, because i have used [10] and set the variable to a string of less letters then 10 and it works fine.
quick question i noticed when i changed char name [10] = { ' \ 0 ' }; to char name [5] = { ' \0 ' }; and then i typed anthony it still worked as is the 5 was a 10 i thought the 10 told the program that the word anthony had to be 5 letters long
@LearnToProgramDotTV I sometimes see code like printf("Length is %zu\n", strlen("hello"));... What is %zu used for? Additionally, I typed your strcat code up and ran it on ideone.com where it gave me the error SIGSEGV (and a wikipedia link to describe it). What does that mean?
@LearnToProgramDotTV I get a crash too, with microsoft visual c++ 2008 express it tells me: Run-Time Check Failure #2 - Stack around the variable 'userName' was corrupted.
I ran it in Dev-C++ and it seemed to work at first, but then when I changed the lastName string to something longer (130 characters) it brought up "Lassoff_Example.exe has encountered a problem and needs to close. We are sorry for the inconvenience." When I tried "Debug" instead of "Run" it caused devcpp to crash!
Do you realize that you're invoking undefined behaviour (thus a potential crash) in here? userName only has room for 5 character (incl. the terminating \0), and you're adding 7 more to that.
when I compile the file the consolee window opens up only to display your name is M but I can type in the rest. why is not showing up with the name already pre-typed in the window?
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
You really should teach to use scanf() with a length specifier to avoid buffer overflows. The "name" example is vulnerable to buffer overflow because you haven't specified a length of characters to read in.
scanf("%s", name);
Should be replaced with:
scanf("%10s", name);
If you know the length of the buffer, then there's no good reason not to specify how many bytes to read. =)
These guys are great man haha. First time i've ever touched stuff like this.
With your part at the end where it had firstString secondString and all that I took a bit of initiative and made it add them together to tell me how many characters there were altogether :P I was quite proud :D. Keep the awesome guides coming
Thanks so much for saying so! I have a couple of new tutorials out, but nothing new on C. Hopefully this week or next I'll have some more. If you subscribe to my channel, you will be notified whenever I come out with a new tutorial. Thanks again!
strcat is the gluing how do I unglue some amount in the middle what function is that.. like
MarkLassoff..
I want to remove Lass.. to get
Markoff
what function is that? i'm trying to make a buffer with removing data anywhere inside .. then joining the left over to make a new data? or there is no such function? not talking about sub stringing.. i want 1 single function
Hi, you said that %d signifier showed that it was a double, however in previous videos I thought you said %lf was a double?
wiggium 4 weeks ago
@wiggium thats right it was a mistake
bondservant4Him 4 weeks ago
Answer the Question please:::
How do I handle key presses and key up events in the windows message loop? I need to be able to call two functions OnKeyUp (char c); and OnKeyDown (char c);???
sonfromheaven 2 months ago
when are you going to post the next video?
AJJSDN 2 months ago
umm..when you made the character for your last name at 5:56. You created 10 elements but 'Lassoff' only contains 6 elements. What happens to other elements left? Thanks!
ParamjitGill1 3 months ago
@ParamjitGill1 The memory for the remaining indexes will remain allocated but not initialized.
LearnToProgramDotTV 3 months ago
@LearnToProgramDotTV waster
jjtheslayer69 1 month ago
Amazing tutorials! Simple to follow and give you good concept.
Fa4stCracka 3 months ago
Thank you very much! :)
Talsciemalegenda 4 months ago
I've subscribed. Please make some more C tutorials. -Cheers.
inu11byte 4 months ago
Thank you for these videos I am learning a lot!
But I do have a question, either I have not heard correctly or you have not explained.
What is the '\0' for? I don't understand it at all... but I do understand the rest of the video.
LadiesmanGW 4 months ago
5:16
pixelnat0r 5 months ago
does defining the character length with [10] give the max amount of characters you can use, because i have used [10] and set the variable to a string of less letters then 10 and it works fine.
CaptainLemonPants 6 months ago
i cant find your next video is this your last one ?
bkgamesinc 6 months ago
quick question i noticed when i changed char name [10] = { ' \ 0 ' }; to char name [5] = { ' \0 ' }; and then i typed anthony it still worked as is the 5 was a 10 i thought the 10 told the program that the word anthony had to be 5 letters long
amperamp5 6 months ago
ya this lesson was a lil hard but i think i understand it it was just alot being said and learned at once but still a great video
amperamp5 6 months ago
u really made me understand the intros of c as they were giving me headache
ian101ist 7 months ago
@LearnToProgramDotTV I sometimes see code like printf("Length is %zu\n", strlen("hello"));... What is %zu used for? Additionally, I typed your strcat code up and ran it on ideone.com where it gave me the error SIGSEGV (and a wikipedia link to describe it). What does that mean?
n00peh 7 months ago
@n00peh %zu is the sizeOf operator. It will return the number of bytes the datatype used takes in your machine's particular architecture.
I haven't tested anything in ideone.com, so I can't really address your comment about that. Sorry.
LearnToProgramDotTV 7 months ago
@LearnToProgramDotTV Oh. I tested it in my debugger which seems to indicate something is wrong with strcat(userName, lastName);...
n00peh 7 months ago
@LearnToProgramDotTV I get a crash too, with microsoft visual c++ 2008 express it tells me: Run-Time Check Failure #2 - Stack around the variable 'userName' was corrupted.
I ran it in Dev-C++ and it seemed to work at first, but then when I changed the lastName string to something longer (130 characters) it brought up "Lassoff_Example.exe has encountered a problem and needs to close. We are sorry for the inconvenience." When I tried "Debug" instead of "Run" it caused devcpp to crash!
geekycode 5 months ago
i have a problem
during printf(your name etc
it wont run because it says 'synatx error before printf
sreychresse 7 months ago
Thanks. Help a lot.
ludvikasfilmskapare1 8 months ago
thank you sir
swed3344gh7 8 months ago
Do you realize that you're invoking undefined behaviour (thus a potential crash) in here? userName only has room for 5 character (incl. the terminating \0), and you're adding 7 more to that.
darkuran 9 months ago
why getchar() twice? :P
shadowsimbiote2 9 months ago
Where is part 4? I'm learning so much from you! I really hope that you continue the C tutorials!
bigshotking12345 9 months ago
%d is for decimal, meaning integer..... i think double is %lf.... but this does not take away how good the tutorial is, its really helpful thanks
Vikosaurus 9 months ago
thanks soo much mark! your tutorials made my life a lot easier!! you should be a professor!!
mosawimmz 9 months ago
Need more C tutorials! These are the only good ones! :(
AutomatonGames 10 months ago
HELP :D i cant use stdio.H :S how can i downlaod the Stdio and download it so i can use it (vista) hope u guys understamd:S
tibiaowned1 10 months ago
when I compile the file the consolee window opens up only to display your name is M but I can type in the rest. why is not showing up with the name already pre-typed in the window?
monkeyThe3 10 months ago
%d is an integer not a double, %lf is double
bondservant4Him 11 months ago 2
@bondservant4Him agreed
k1ller2one 10 months ago
great vids keep the brilliant work up Mark!
bulitbill12 11 months ago
I couldnot find the next part turorial.
Shresthahari1 11 months ago
Thanks for another brilliant episode of programming goodness!
bulitbill12 11 months ago
you say %d is a double, i thought it was a int?
FudgeY1337 1 year ago
Please continue onto this series, I love these tutorials!
mrlogan1144 1 year ago
why do we need getchar() ? wht is getchar() function used for?
kuha5ster 1 year ago
@kuha5ster To get an imput and not to close the program.
DeeWeext 1 year ago
@kuha5ster makes it so that when the console appears it doesn't instantly disappear
Nickiscoollikebunnyz 11 months ago
Please make a tutorial 4!
I love your series and i have subscribed and rated!
livehotel1 1 year ago
these tutorials are simply amazing, and your voice is clear and easy to listen to
astounding teacher
jontheskillful 1 year ago
u r greaat sirrr.....excellant
talkbuzz 1 year ago
ur tutorials are great!! even an elementary student can follow and learn from this.. i'll subscribe..
darksideXXXXX 1 year ago
I have started to get ahead of what is happening in the video at times. I think this means im learning :)
OliverCooksey 1 year ago
%d returns a integer not a double. A double is %lf
darkestshadow21 1 year ago 2
your tutorials are amazingly easy to understand please make some more
L337L0L 1 year ago
I have tried this Tutorial.
The code do not work for me
lperez0817 1 year ago
Fuck im confused...
Metal404Head 1 year ago
on strings i am getting warnings source files not compiled?
Destroyer19941995 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
very good tutorials
mcgath2 1 year ago
wow.. Lassoff, kinda like a longer laughing my ass off... haha.. just joking..
halang2x 1 year ago
Was this the last in the series?
TheDarkSagan 1 year ago
Kinda lost me at the end.
TheDarkSagan 1 year ago
You really should teach to use scanf() with a length specifier to avoid buffer overflows. The "name" example is vulnerable to buffer overflow because you haven't specified a length of characters to read in.
scanf("%s", name);
Should be replaced with:
scanf("%10s", name);
If you know the length of the buffer, then there's no good reason not to specify how many bytes to read. =)
n9nes9 1 year ago
Console.WriteLIne("What is your name?");
string name = Console.ReadLIne();
Console.WriteLIne("Hello" + name + "How are you doing");
hajiamano22 1 year ago
Tutorial 1and 2 were easy but this one confuses me X_x
jigglethat 1 year ago
@jigglethat Same here! I find 2:01-5.00 really hard to understand!
TheChemistSupreme 1 year ago
@TheChemistSupreme i'M not really good with C++ but if you look at it the same in C# it looks as if hes creating a array.
hajiamano22 1 year ago
These guys are great man haha. First time i've ever touched stuff like this.
With your part at the end where it had firstString secondString and all that I took a bit of initiative and made it add them together to tell me how many characters there were altogether :P I was quite proud :D. Keep the awesome guides coming
shawyer999 1 year ago
now i dont get it *-(
manutube8080 1 year ago 2
Please make more about C. Thank you for 3 episodes.
MarkoVojvodic84 2 years ago
This comment has received too many negative votes show
can u make a vid on how to code hacks for crossfire ?
nitebomb1 2 years ago
did you make any new tutorials in this series? Your tutorials are excellent.
Thanks
mttube321 2 years ago
Thanks so much for saying so! I have a couple of new tutorials out, but nothing new on C. Hopefully this week or next I'll have some more. If you subscribe to my channel, you will be notified whenever I come out with a new tutorial. Thanks again!
LearnToProgramDotTV 2 years ago
Metallic voice can ruin your program!
imgoingtokillyourmom 2 years ago
strcat is the gluing how do I unglue some amount in the middle what function is that.. like
MarkLassoff..
I want to remove Lass.. to get
Markoff
what function is that? i'm trying to make a buffer with removing data anywhere inside .. then joining the left over to make a new data? or there is no such function? not talking about sub stringing.. i want 1 single function
Punniabi 2 years ago
strlen counts up to the null terminator \0.. if you add that in the beginning it would say size 1.
Punniabi 2 years ago
thx for this tuts...make some continues.
DubCartel 2 years ago
thanks man. you really deserve more views.
jdude0822 2 years ago
Thanks so much for these tutorials! Please make some more! :)
Mogzieno1 2 years ago
thank you so much please make more soon
Arglem1 2 years ago