Reading and Writing Raw Bytes to Files in C

preview_player
Показать описание
How to open, read, write, and close a file in C is often taught in a way that leads to a fundamental misunderstanding of what is happening when these operations are performed. Typically, the lesson leaves students with the impression that the data types themselves are being written into a file, rather than the raw bytes that store those data. In this video, I demonstrate how to read and write to files in C as well as how to do so with raw bytes.
Рекомендации по теме
Комментарии
Автор

Spent a whole afternoon trying to understand this problem. U made the world a lot easier for me. Thanks for taking the time and sharing .... 🤗

Rehanali
Автор

I was having the same problems, thanks for clearing them up for me! Keep making videos! The world needs more knowledgeable compsci folks putting out videos with REAL explanations!

drewkay
Автор

To read number in string as integer you can use atoi() or strtoi() function that are inside of string.h . It automatically transform string type in integer type. Hoping that help.

mrcoo
Автор

Keep up the good work this video is probrably the best!

mrgamer-luim
Автор

you could used fscanf() or strtoi() or just wrote it binarily to the file to store the number. fscanf you can read a txt based number in and store it as an int, float... strtoi converts string to int.

GRHmedia
Автор

Some very good programming videos here. Thank you.

konstantinrebrov
Автор

Great video Eric! This kind of videos of a short explanation of a very specific topic are interesting

IBRjAI
Автор

You are an excellent teacher! Thanks a lot!

engdoretto
Автор

Your code gives me segmentation fault error, when I try to make copy of the image on desktop, but it's ok if I make copy of image in the project folder. Maybe it's a Windows issue.

slavicakaraterzieva
Автор

All memory allocated was never freed, creating a memory leak. Free(data);

bursthooverbag
Автор

fastest way to read a txt file into buffer or array.which one will work faster for more than 1gb txt file read.
any idea

astonishscenes