I've really appreciated the videos you've made on C programming. College did not leave me with a very strong grasp of lower level programming languages like C and so I've been going through all your videos on C programming; they have been an absolute treasure trove. Unlike other tutorials, you make it a point to explain all the standard functions that are at your disposal and how you may want to use them in different circumstances, and you also make it a point to explain why you are doing what you are doing when it comes to manual memory management. You're a legend 💪🏽
@PortfolioCourses Жыл бұрын
Thank you very much for sharing this kind feedback with me, it's very encouraging for me to hear that these videos are helping you out and that you're enjoying the teaching style. :-D
@Flaxxeed7 ай бұрын
Could u help me understand how to store and edit information in a file that's in like a table?
@gringotico17592 жыл бұрын
Great job. Way better that the top results on the topic. Much appreciated.
@PortfolioCourses2 жыл бұрын
Thank you very much for the kind feedback! :-)
@NEKI01019 Жыл бұрын
The best C programming tutorial series ever! I feel so satisfied that I now know everything you taught. For the starters to C, I highly recommend to follow the whole playlist.
@luizg.55269 ай бұрын
For this 24min long video full of quality information, I just want to thank you!
@PortfolioCourses9 ай бұрын
You're very welcome! :-)
@lazygamez728011 ай бұрын
I am 100% sure when saying this that you got some of the best, most high quality content right here. In school they didnt explain files very well and this video did it in 20 minutes. Thank you so much
@llynxfyremusic2 жыл бұрын
Thanks for this! Really clear and easy to understand.
@PortfolioCourses2 жыл бұрын
You're welcome! I'm glad to hear you found it clear and easy to understand. :-D
@tekamer6566 Жыл бұрын
Amazing that you still read the comments on these videos. God bless you for that
@PortfolioCourses Жыл бұрын
Thank you! I love reading the comments, the people that watch these videos tend to be very supportive. :-)
@steevenkenny97912 жыл бұрын
The explanation is crystal clear... great job sir...
@PortfolioCourses2 жыл бұрын
Thank you, I'm glad you enjoyed it! :-)
@firepower012 жыл бұрын
This is an awesome tutorial man, thanks a lot.
@PortfolioCourses2 жыл бұрын
You're welcome! 😀
@Cool-Linux-Penguin5 ай бұрын
This was very helpful, thank you so much! Also I know it's 2 year's old but this video is rock solid and the instruction's and explaination's are great!
@justcurious1940 Жыл бұрын
Thank u DR kevin, your tutorials are the best.
@PortfolioCourses Жыл бұрын
You’re welcome, I’m glad you enjoy the tutorials! :-)
@rfdave3980 Жыл бұрын
Nothing better than C.
@PortfolioCourses Жыл бұрын
I agree. :-)
@okibeogomola5921 Жыл бұрын
before watching your videos , I click like because I know for sure its going to be great, keep up the great content sir.
@PortfolioCourses Жыл бұрын
I'm so glad to hear you're enjoying the content, and thank you for the support Okibe! :-)
@uberblarrf Жыл бұрын
best tutorials on youtube, thank you so much 🙂
@PortfolioCourses Жыл бұрын
You're very welcome, and thank you for the kind feedback! :-)
@mro74322 жыл бұрын
very helpful video man ngl, thanks for sharing this knowledge for free
@PortfolioCourses2 жыл бұрын
You're welcome! 🙂
@hyperphenomenal4360 Жыл бұрын
to the point and excellent explanation, your videos are treasure trove
@edwardmalegale2302 жыл бұрын
You saved my technical interview ☺
@PortfolioCourses2 жыл бұрын
I’m glad to hear this helped you Edward, and I hope you get the job! :-)
@ecro52362 жыл бұрын
Thanks for this great tutorial!
@PortfolioCourses2 жыл бұрын
You're welcome! :-D
@dharmik0238 ай бұрын
Literally 🥶 your video is so amazing and useful for college students!
@eighteen78752 жыл бұрын
Thanks bro! Always helping
@PortfolioCourses2 жыл бұрын
You’re welcome! Thanks for all the encouraging feedback.
@darrenli2526 Жыл бұрын
thank you so much, you saved my assignment
@PortfolioCourses Жыл бұрын
You’re very welcome, and good luck on the assignment! :-)
@yusufetturki2 жыл бұрын
its really good explanation and tutorial thanks.
@PortfolioCourses2 жыл бұрын
You’re welcome Yusuf! :-)
@ABDELMUNIEMOMARSULIMANAHMEDTEE Жыл бұрын
nice explanation, I really appreciate this.
@PortfolioCourses Жыл бұрын
You're welcome Abdelmuniem, I'm glad you enjoyed the explanation! :-)
@ellismail7196 Жыл бұрын
i really appreciae your effort, and i like the way you explain things and make it easier and smooth, but i've a question that popped up in to my mind, why either fgets or fscanf get into the new line just by using while without doing increment to the new line !
@justcurious1940 Жыл бұрын
I think it's because of the file position indicator inside our object of the type FILE , I know it may sound complicated but it's not !! when we say FILE *object = fopen("x.txt","r") ; we are actually creating a variable(object) of type struct and inside this struct there is variable that changes each time we call fgets or fgetc .. notice every time we call those function we are passing our object of of FILE(struct) type as pointer so changes will apply and remain in our main object, maybe my explanation is not totally accurate because object is a pointer of type FILE but I think the logic of it is like that. the question that popped up into my mind is how is it possible write to a txt file the same way u write to the console, it's strange to me and it does not make sense but I did some researches and people are saying that everything in our computers is files,what the F**k they mean by that , it does not make any sense , it does not make any sense because our brains get mess up with too much abstraction from windows,I think an operating system course is needed to understand these topics so yea I'm going to take one, sorry if I wasted your time !!
@jakke19752 ай бұрын
do you also have a tutorial on open instead of fopen? i'm starting with the basics... taking steps before i run
@juniorrokudevelopertutoria37343 ай бұрын
Great video!
@dailyjihad83962 жыл бұрын
That's really helpful , thanks alot
@PortfolioCourses2 жыл бұрын
You're welcome! 😀
@idanmariani8601 Жыл бұрын
awsome video like allways best explain ever..thank you for all the hard work you put to help us.. your awsome.. :)
@PortfolioCourses Жыл бұрын
You're welcome Idan I'm glad you enjoyed the explanation, and thank you for the very positive and encouraging feedback too. :-)
@DiogoGaming2 Жыл бұрын
This video is a big "W"
@PortfolioCourses Жыл бұрын
I’m glad you enjoyed it! :-)
@khomo124 ай бұрын
Thank you!
@barkotzeyohannes41042 жыл бұрын
I wish you were my professor!!
@PortfolioCourses2 жыл бұрын
Aww thanks Barkot that is such nice positive feedback and it means a lot to me! :-)
@lradhakrishnarao9022 жыл бұрын
There's only one thing missing. Why do we need to use file, and what benefits they offer . Because, this is usually asked in the interview questions.
@PortfolioCourses2 жыл бұрын
Great question! :-) Basically, if we store data into variables, the data will disappear when our program stops execution. Storing data into a file allows us to retrieve the data later, even if we restart our program, or even our computer. Storing data into a file also allows us to make copies of the file, and share the file with others.
@saifUllah-q4e1c2 ай бұрын
thank you
@creatively12086 ай бұрын
you are the goat
@ionguzun39522 жыл бұрын
can you please do a video about files and structures in c
@PortfolioCourses2 жыл бұрын
Like reading data from a file into a struct?
@wambateufack3 ай бұрын
Thanks sir
@tokuumeiii87928 ай бұрын
it doesn't work on codeblocks doesn'it ?
@Maik.iptoux10 ай бұрын
What is when my input file had a unknow size of lines? But i wan't to have all in the buffer?
@PortfolioCourses10 ай бұрын
You might find this video interesting if I’m understand what you are asking correctly: kzbin.info/www/bejne/hZLCm5xpmal5m9ksi=ZOfk9MAH--lfCKV1
@PortfolioCourses10 ай бұрын
And this video may be of interest too: kzbin.info/www/bejne/rILRoGyJaN55bpIsi=rnRtjymSMC5jjI2F
@preciouslife1212 Жыл бұрын
thank you so much
@PortfolioCourses Жыл бұрын
You're very welcome Robel! :-)
@krishnabhagavankarri5623 Жыл бұрын
Which command-line interface are you using,sir? I can't use 'touch',vi commands in my windows 11 terminal or command prompt. What do I have to do...?😒
@PortfolioCourses Жыл бұрын
Great question Krishna! :-) I am using Terminal on Mac OS, which is a "bash shell", a type of shell that is used in Unix-like systems like Linux and Mac OS. A Windows shell is different and does not support the same commands. So something like 'touch' will not work on Windows. You could use a text editor instead to create a file and open it though. In many situations Windows will have a command that allow us to do 'the equivalent' of what we can do with a Terminal command: stackoverflow.com/a/37756874. It's also possible to get a Linux shell on Windows using things like Windows Subsystem for Linux, but that can be a fair bit of work and would be challenging for new beginners I think (though it may be a good learning experience).
@stevejokes21822 жыл бұрын
How to generate all output in terminal into .dat file?
@PortfolioCourses2 жыл бұрын
Great question Steve. 🙂 Where is the output in the terminal coming form? Is it text that the user is typing in? Or is it output from the program that is running?
@smadi0x86 Жыл бұрын
hello!, what if I want to read a second number on the same line seperated by a space from the first
@PortfolioCourses Жыл бұрын
Great question Saud! :-) You could do something like this: fscanf(file, "%f %f", &dblvar1, &dblvar2); You might find this related video interesting: kzbin.info/www/bejne/fZLUYmN9d9GFgKM
@BalaSubramanian-rw4js Жыл бұрын
Can you tell what compiler you are using
@PortfolioCourses Жыл бұрын
In this video I am using Visual Studio Code as a text editor and the gcc compiler with the terminal on a Mac. :-)
@yogeshchauhan9401 Жыл бұрын
Can u explain feof function?
@PortfolioCourses Жыл бұрын
Basically the feof() function returns true when we reach the end of a file, and false otherwise. This explains more: www.tutorialspoint.com/c_standard_library/c_function_feof.htm. I may try to make a video on feof() specifically though, that might be something people would be interested in. :-)
@yogeshchauhan9401 Жыл бұрын
@@PortfolioCourses thanks for the response.Can u see this statement is this correct? It's important to note that feof only tells you if you've reached the end of the file after you've tried to read past it.
@PortfolioCourses Жыл бұрын
I believe that statement is correct, yes. :-)
@PortfolioCourses Жыл бұрын
Here you go, a new video on the feof() function: kzbin.info/www/bejne/i5qTmpeBbqmbZpY
@mohammadmousavi60462 жыл бұрын
thanks for video ! 😉😉🧡🧡🧡🧡 , please create new course for advanced c and using c in real project
@PortfolioCourses2 жыл бұрын
You're welcome Mohammad! 🙂 Maybe one day I can create a course on advanced C, but I think a course on advanced C would probably be many courses covering different subtopics like threads, networking, etc.
@CodyHoskin3 жыл бұрын
How do I extract a float number from a text file? lol
@PortfolioCourses3 жыл бұрын
Maybe I'll make a video on this soon! In the meantime, this answer here is pretty good, you basically can use fscanf() with %f and %lf to read in floats and doubles from a file: stackoverflow.com/a/7152018
@paganimarker1898 Жыл бұрын
I want to ask what is the meaning of exit(1)/exit(-1) FILE *pd; if((pd = fopen("test","w")) == NULL) { puts("Can`t be done."); exit(-1); } Is the same as return 0/1; ??
@PortfolioCourses Жыл бұрын
Great question Pagani! :-) When we call exit() the program will exit, and the argument we provide to exit() will be the status code. If we have exit(0) the program will exit with status code 0, which is considered 'success'. If we have exit(1) or exit(-1) the program will exit with status code 1 or -1, both of which are considered 'error' (any non-zero exit status code is considered 'error'). When we use return 0 in main the program will exit with status 0, and if we use return 1 in main the program will exit with status 1. But we can only use return to exit the program in main. If we want to exit the program in other functions, we can use exit instead. So that's the biggest difference.... with exit we can exit the program in any function. This video covers exit(): kzbin.info/www/bejne/boPYlKuJmqaYo9k. The other thing we can do with exit is setup functions to run when the program exists, this video covers that topic: kzbin.info/www/bejne/f5yWn62mo5p_pac. Hopefully this helps! :-)
@paganimarker1898 Жыл бұрын
@@PortfolioCourses wow, thank you !
@PortfolioCourses Жыл бұрын
@@paganimarker1898 You're welcome! 🙂
@paganimarker1898 Жыл бұрын
is "w" the only way to create file?
@PortfolioCourses Жыл бұрын
Great question Pagani! :-) We could use "a" for append and that will also create the file if it doesn't exist. This article does a good job talking about the different access modes: www.geeksforgeeks.org/basics-file-handling-c/.
@paganimarker1898 Жыл бұрын
@@PortfolioCourses Thank you
@PortfolioCourses Жыл бұрын
You're welcome! :-)
@vinamrgroverDemontutorials2 жыл бұрын
underrated channel (^_^)
@PortfolioCourses2 жыл бұрын
Thank you Vinamr! :-D
@iGavid_Doggins2 жыл бұрын
I need some help please, I'm trying to read integers from a .txt file and add them together. The problem is the file also contains letters, kinda like this: Peter 20 Frank 30 Joe 40.... I want to ignore letters completely and just add the numbers together, too tricky for me....
@iGavid_Doggins2 жыл бұрын
Some additional info, the way I wrote to the file was: fprintf(fp, "Peter %d ", userNames(varOne));
@PortfolioCourses2 жыл бұрын
So there isn't really a super easy answer to this question, it's a bit tricky. There are a few ways you could do it. :-) You could read each entire line into a string (char array) and then use strtok() to pull out the integer you're interested in. These examples might help with that approach, the link to the video tutorial is at the top of the file in the comments: github.com/portfoliocourses/c-example-code/blob/main/file_lines_to_string_array.c github.com/portfoliocourses/c-example-code/blob/main/strtok.c Another way to do it would be closer to the way this 'read from CSV file' example uses fscanf(), again the link to the video is at the top of the file: github.com/portfoliocourses/c-example-code/blob/main/csv_to_struct_array.c So at the bottom of that code there is a loop that uses fscanf() to read the data from the file. If you had variables: char name[2048]; int number; You could then have fscanf: fscanf(file,%2048[^0123456789]%d ",name,&number); To read in each number, in a similar way to that example. You would then have to add the numbers together.
@iGavid_Doggins2 жыл бұрын
@@PortfolioCourses Wow thanks dude, I'm gonna go through all of this step by step. There is so much to learn😮... I remember someone saying "C is easy and beginner friendly, it only has 32 keywords". 🤣 By the way your content is absolutely GREAT.🏆🥇🏆
@PortfolioCourses2 жыл бұрын
@@iGavid_Doggins Oh wow haha I would say C is one of the less forgiving languages, especially compared to something like Python. 🙂 And thank you for the kind words I'm glad to hear you enjoy the content!
@davidwesh4123 Жыл бұрын
Good
@PortfolioCourses Жыл бұрын
Thank you David! :-)
@emanuel_ramaci Жыл бұрын
why fgets() read only first line of "in.txt" ? because in "in.txt" i wrote more than one line by sending a new line. thank you!!
@PortfolioCourses Жыл бұрын
Great question Emanuel! :-) Though the answer is essentially.... because that's how fgets() works. It stops at the first newline it encounters. If you want to read all the file contents into a string this video might help with that: kzbin.info/www/bejne/eaukmIBrl8qtY8k.
@emanuel_ramaci Жыл бұрын
@@PortfolioCourses i just watched the video and it's great the way you explain it, thank you very much!!
@PortfolioCourses Жыл бұрын
@@emanuel_ramaci Awesome, and you're welcome! 🙂
@l0gi550 Жыл бұрын
This is a great tutorial, thanks!
@farhanishraq5812 Жыл бұрын
thank u so much
@PortfolioCourses Жыл бұрын
You're welcome, I'm glad you enjoyed the video! :-)