I did, but i was wrong... in one point... you really copied the code exactly. And stahta01 might be wrong too. Why is that so? Because you hit one of these total obscure c features.
The feature you are using there was invented 30 years ago but was so bad that the c standards committee said it should not be used and removed it 20 years ago. Why is it working for the dude in the video? Because he is compiling the code in c89 mode. Why does stahta01 get warnings and think you dont know the difference warning and error? Because he is compiling in c99 mode and gets warnings about it. Why doesnt it work for you? I dont know because you didnt provide enough information. You either compile in c99 mode and get warnings or compile in any c++ mode and get errors.
And how is that related to CodeBlocks? Nothing it all! This is a question about c language features and compilers implementing them. CodeBlocks isnt part of the c standards committee nor a compiler, it is basically a nice text editor that can launch many compilers. Unless one of these things doesnt work, it is not a CodeBlocks problem and therefor not the place to be asked here, the poor people here have enough to do to take care about CodeBlocks issues, they cant help with others topics.
But congratulations, you found a dude on YouTube who is using languages features that should not be used for 20 years now and he is proposing these to people who start programming today. Really, this guy knows pretty much nothing about programming, only how to make videos and earn money from ads. You really should not watch videos on YouTube to learn anything, they do more harm than good. This is like you try to build spaceships by watching Star Wars.