So many thanks to each of your videos! I myself study C and the possibly interesting topic for video creation is commas and the creation of variables in IF Conditions In C, unfortunately, you cannot write the following: if (int test = 5, test != NULL) { printf("yes "); } So here we declaring variable in if statement, that can be done since C99, but we cannot do it in one expression with comma operator. BUT we can do this: int test; if (test = 5, test ==5) { printf("yes "); } and it will work.
@saidrafili262 Жыл бұрын
Hello Sir. I have a question from the video. Why on 6:48 you declared a char variable with pointer? What is the difference between char *sr1 = "a string to print from the middle"; and char sr1[ ] = "a string to print from the middle" ? Why do you use pointer? In C++ when I declare a variable like this, I get the error ' ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] ' Thank you beforehand.
@PortfolioCourses Жыл бұрын
Great question Said! :-) This video explains the difference between the two: kzbin.info/www/bejne/h6GWiJSqgbGSfsU. :-) We could have used char s1[] in this video and it would have worked too, there isn't any reason in particular why I used a pointer. If we needed to modify the string we would definitely want to use char s1[] instead though, the video will hopefully explain this for you.
@saidrafili262 Жыл бұрын
@@PortfolioCourses Thank you so much Sir!
@PortfolioCourses Жыл бұрын
@@saidrafili262 You're welcome Said! 🙂
@mehdi-s6r5 ай бұрын
That is useful, thanks sir
@drigao522 жыл бұрын
which IDE do you use?
@PortfolioCourses2 жыл бұрын
Hi Rodrigo! I use Xcode on Mac. Though sometimes I use Visual Studio Code & gcc on a terminal / command-line. :-)
@lioncraft58422 жыл бұрын
Hmm can u do video using pointers &2D arrays ....🙈
@PortfolioCourses2 жыл бұрын
So we have videos on pointers: kzbin.info/www/bejne/aHinmot9areZhKc And 2D arrays: kzbin.info/www/bejne/kIazl4qwidGDmKc But do you want a video on pointers and 2D arrays together? Like how to dynamically allocate 2D arrays for example? :-D That's a good idea too!
@JH-ux1re2 жыл бұрын
Haha, I’m learning this part too! So confused 😕
@PortfolioCourses2 жыл бұрын
@@JH-ux1re Just curious, what types of questions are your instructors giving you on these concepts?
@JH-ux1re2 жыл бұрын
@@PortfolioCourses The assignment last week asked us to print Pascal triangle (not a tree, but right triangle) and the rainfall data for four weather stations in a certain county recorded in the table.
@JH-ux1re2 жыл бұрын
@@PortfolioCourses My professor didn’t ask us to use file open to read the table, but I want to know how to use it instead of typing all the data in the curly bracket. If you could make a video to show how to use file open and 2D arrays to read a table and do some calculations and write to a new txt file, that would be super great! The finals are coming, I really want to do a good review! Thank you!