Skip to content

cartel-developer/cpp-text-file-io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

C++ File I/O Basics

A simple C++ project that demonstrates reading from and writing to text files using clean and readable code practices inspired by the principles of the Clean Code book.

Features

  • Write text into a file
  • Read text from a file
  • Simple error handling
  • Clear function separation
  • Beginner-friendly implementation

Technologies

  • C++
  • Standard Library
    • <iostream>
    • <fstream>

Project Structure

writeFile()

Writes text into a file.

readFile()

Reads and prints file content line by line.

Clean Code Principles Used

This project attempts to follow several Clean Code practices, including:

  • Meaningful function names
  • Small and focused functions
  • Readable formatting
  • Use of constants instead of magic strings
  • Simple and understandable logic

Example Output

Hello world
Example Code

Build & Run

Compile using g++:

g++ main.cpp -o app

Run:

./app

About

A simple C++ project for reading from and writing to text files using clean and readable code principles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages