Binary File Access Introduction | C Programming Example

  Рет қаралды 26,830

Portfolio Courses

Portfolio Courses

Күн бұрын

Пікірлер: 33
@murtazotoshniyozov4688
@murtazotoshniyozov4688 2 жыл бұрын
Wow. Now I see how binary files are faster and take less memory thank text files.👍👍👍👍 Thank you Ms.Kevin
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You're welcome! :-)
@TylerBrooker
@TylerBrooker 3 ай бұрын
Quick question, I noticed that sometimes in a binary file, integers are 4 bytes, but are represented in reverse, e.g. the largest positive value for a signed 4 byte int should be 7f ff ff ff before going into a large negative number, but it shows as ff ff ff 7f. Do you know why this might be?
@doron8536
@doron8536 4 ай бұрын
Thank you so much for your imppecable explanations! your videos help me immensely in understanding C. Quick question, couldn't you use fscanf to read the numbers from the txt file? instead of using the atoi function?
@PortfolioCourses
@PortfolioCourses 4 ай бұрын
You're very welcome, I'm glad to hear these videos are helpful for you! :-) You could use fscanf() too, yes!
@doron8536
@doron8536 4 ай бұрын
@@PortfolioCourses Thanks!
@heitorheitorheitor8158
@heitorheitorheitor8158 2 жыл бұрын
amazing explanation!!
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Thank you! :-D
@tails_the_god
@tails_the_god 2 жыл бұрын
Hi thanks for clearing this up! Now.... I have a question why do some c projects have like multiple definitions and declarations of the same procedure, type or variable appear in headers alot?
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
That's a good question. :-) Do you have a link to any of these projects? I'd be curious to see exactly what they're doing so I could answer this question better. I'm also wondering if the definitions are "100% exactly the same" or slightly different.
@shlomiashkenazi8844
@shlomiashkenazi8844 8 ай бұрын
Hey, great video.. 1 question tho: When you say 1 will be represented by 48 and then 48 will be represented by the 8 bits, what is it really means? Why its converting it to 48? is it ASCII?
@silloo2072
@silloo2072 5 ай бұрын
Exemple
@vladguzun2522
@vladguzun2522 2 жыл бұрын
amazing video , can you make a video 'When I create a vector , let's say size of 5 , elements are 1,2,3,4,5 and I want to add at the location( for example index 2) the numbers 200 and 300 , the vector should look like 1 ,2 ,200,300,3,4,5.'
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Thank you Vlad! :-) Is this question written down anywhere? That might help me to make a video on it. Also, is a "vector" of numbers always added to the other vector starting at a shifted location? Or is always the numbers 200 and 300 at index 2? Or can the numbers change? Is it always 2 numbers? Knowing these sorts of things would help to answer the question, but it's written down anywhere that would really help.
@billp37abq
@billp37abq Жыл бұрын
How did you get gcc c/terminal/bash working with Visual Studio?
@PortfolioCourses
@PortfolioCourses Жыл бұрын
In this video I am actually just using a Terminal in MacOS that I've put next to Visual Studio Code, so I'm not using the terminal "in" Visual Studio Code, it's running as a separate program, that's just my personal preference. :-)
@goblin69_420
@goblin69_420 9 ай бұрын
You can run bash from VS Code
@filmaker256
@filmaker256 Жыл бұрын
How would you convert the text file to binary file?
@PortfolioCourses
@PortfolioCourses Жыл бұрын
I would read the file contents as a normal text file into a string: kzbin.info/www/bejne/eaukmIBrl8qtY8k. Then I would write the file contents back to the same file, but this time opened as a binary text file. And that should do it. :-) Maybe I can make a video on this, it's a good question and a fun idea.
@filmaker256
@filmaker256 Жыл бұрын
@@PortfolioCourses Hi yes please do! Im sure it would make it very clear to people who are less experienced . Thanks!
@PortfolioCourses
@PortfolioCourses Жыл бұрын
@@filmaker256 Thanks for the idea. 🙂
@themohmand
@themohmand 2 жыл бұрын
Hi, how would you write to a specific memory address in a binary file?
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
I'm not sure what you mean by memory address in a binary file, do you mean a certain amount of byes from the start of the file?
@themohmand
@themohmand 2 жыл бұрын
@@PortfolioCourses For example, I have a bin file that I get after compiling/linking my code. Afterwards I would like to change the values of certain variables I had defined in my code. Would it be possible to do so? I can find the memory addresses where the target variables, just need to replace the values there, and would like to do this in a similar way that you very nicely did in your video.
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
@@themohmand OK, I'll think about this one and whether it's possible to make a video on it some day. I'm not sure if it is possible to change the value of a variable as the compiler might make some optimizations that involve a value being present in multiple places in a binary file, I'm not sure. But I suspect this is sometimes possible to do.
@themohmand
@themohmand 2 жыл бұрын
@@PortfolioCourses I solved this in another way, I find the addresses for the variables I'm looking for in the .map file, then I replace those addresses in the .bin file with values I want using a simple powershell writeallbytes function. It's a workaround but it works for now, and I'll use it until I can come up with doing it all directly in the .bin file without involving the .map file.
@themohmand
@themohmand 2 жыл бұрын
Oh and I should've mentioned this earlier but I am working with executables for a microcontroller.
@danielanderson222
@danielanderson222 Жыл бұрын
make a udemy TCP/IP course
@PortfolioCourses
@PortfolioCourses Жыл бұрын
On TCP/IP or TCP/IP and C? Is there a project that could be built using TCP/IP that you think would be good? :-)
@danielanderson222
@danielanderson222 Жыл бұрын
@@PortfolioCourses A good idea is making a TCP/IP chat program and possibly a chatroom program
Register Variables | C Programming Tutorial
5:28
Portfolio Courses
Рет қаралды 9 М.
Read And Write An Array Of Structs To A Binary File | C Programming Example
18:27
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 25 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 21 МЛН
BINARY vs TEXT File Serialization
13:49
The Cherno
Рет қаралды 55 М.
How to use binary files [an updated C++ tutorial]
19:18
Professor Hank Stalica
Рет қаралды 18 М.
File Access Basics | C Programming Tutorial
24:05
Portfolio Courses
Рет қаралды 96 М.
What are Executables? | bin 0x00
8:35
PwnFunction
Рет қаралды 188 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 265 М.
the cleanest feature in C that you've probably never heard of
8:13
why do header files even exist?
10:53
Low Level
Рет қаралды 426 М.
how Google writes gorgeous C++
7:40
Low Level
Рет қаралды 935 М.
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 25 МЛН