@CodeBeauty

πŸ“š Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: https://bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: https://bit.ly/FreeObjectPascalEbook
πŸš€πŸ“ˆπŸ’»πŸ”₯ My Practical Programming Course: https://www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
πŸ’° Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.

@TechandMystery

You described how to do all this in 20 minutes, what my school book took a million pages to describe. (Give or take a few hundred thousand pages.) Thank you!

@klevismema4998

Hey I commented in your last video and I said I was going to have a exam in c++ . I  managed to get a 10/10  max score, thank you very much for helping me personally it was such a great journey through these series.

@meekosalas1153

Prefect timing, we are dealing with File I/O this week in class

@d3v1ce

hiya, im only 4 years late here but thank you so much for saving lives one day before my exam

@sehrishzarin2431

my course constructors  ignored this chapter even in exams last semester , now that i want to make my own project i realized how important this topic is

@luxis_2295

I’ve been having the doubt of how read and write from a file for weeks because my programming professor did not explained as good as you. You were the light that lit the way for me because I needed it for a project. Thank you Saldina!!

@potatoitis3326

Saldina thank you for making this concept easier to understand. You are definitely an inspiration and I hope to be as great at programming just like you someday.

@con_el_maestro3544

I cannot believe that I finally understand this, I'm gonna cry😭. Anyway let me get started with the homework you gave us

@priyanshusaxena7157

My solution for the 1st challenge, converting a story to cipher and deciphering back the code in the console:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
    fstream Myfile;


    // Taking the input string from the user

    string story;
    cout << "Enter a story: \n";
    getline(cin, story);

    // Converting the string to character array

    char story_char[story.length()];
    for (int i = 0; i < story.length(); i++)
    {
        story_char[i] = story[i];
    }

    // Ciphering the story and writing it into the file.....

    Myfile.open("story.txt", ios::out);
    if (Myfile.is_open())
    {
        for (int i = 0; i < story.length(); i++)
        {
            Myfile << int(story_char[i]);
        }
    }
    Myfile.close();

    // De-ciphering the numbers into story.....
    cout << "The deciphered numbers form the story:\n ";
    Myfile.open("story.txt", ios::in);
    if (Myfile.is_open())
    {
        string line;
        while(getline(Myfile, line)){
            int num = 0;
            for(int i = 0; i < line.length(); i++){
                num = num * 10 + (line[i] - '0');
                if(num>=32 && num<=122){
                    char ch = (char)num;
                    cout << ch;
                    num = 0;
                }
            }
        }
    }
    Myfile.close();

    return 0;
}
Input: 
Hello, my name is Priyanshu Saxena, and I am from India, and I love watching videos on CodeBeauty channel.
Ciphered Text: 72101108108111443210912132110971091013210511532801141051219711011510411732839712010111097443297110100327332971093210211411110932731101001059744329711010032733210811111810132119971169910410511010332118105100101111115321111103267111100101661019711711612132991049711011010110846
Deciphered in the console: 
Hello, my name is Priyanshu Saxena, and I am from India, and I love watching videos on CodeBeauty channel.

@Seanxiao-p3r

I recently started to work on a project which is in C++. I literally knows nothing about C++ and came to you channel. You literally saved my work... Please continue doing this! Many thanks!

@omarbenamer9985

IT HAS BEEN DAYS OF HARDWORK THAT I PASSED THROUGH IN ORDER TO GET MY FIRST APPLICATION, WHICH IS CONCERNED TO BE THE END OF THE YEAR FINAL PROJECT
BY YOUR ENLIGHTENMENT; YOU MAKE ME SO HAPPY BECAUSE I COULD SOLVE MANY PROBLEMS THAT I FACED WITH FILES

@bigbro_songz

Big Bro
3 minutes ago
I just love how you make coding so simple, Saldina. You have a great gift. Keep up the good workπŸ‘πŸ½πŸ‘πŸ½πŸ‘πŸ½

@sinnyx3248

explained my 3 lectures from college in 15 mins!! this is so sick because Ive actually understood  you better

@fishtailsL0

New video from codeBeauty notification, me on the road running as fast as I can to watch it. Thanks Saldina.

@Lancelot251

The answer to the ques 1 is this :   

#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
	fstream file;
	
	//user input 
	string cont;
	cout<<"Enter the story :\n";
	getline(cin,cont);
	
	//writing the content to be encoded
	file.open("enconding.txt",ios::out);//write
	  if(file.is_open())
	  {
		for(int i=0;i<cont.length();i++)
		{
			file<<int(cont[i]);
		}
   	  }
   	file.close(); 
	
	//processing the out put to the console in the decrypted form
	cout<<" \n\nThe decoded text is : \n\n";
	
	file.open("enconding.txt",ios::in);//read
	   if(file.is_open())
	   {
	   	  string line;
	   	  while(getline(file,line))
	   	  {
	   	  	int a=0;
	   	  	for(int i=0;i<line.length();i++)
	   	  	{
	   	  	    a=a*10+(line[i]-'0');
			    if(a>=32 && a<=122)
			    {
			 	char ch =  char (a);
			 	cout<<ch;
			 	a=0;
			    }
		   }
	     }
	   } 
	file.close();
	
	return 0;
}

Input : this is nice.

clipped text in the file is : 116104105115321051153211010599101

@asishcodes

I have an exam on Object oriented programming in less than 2 hours and these videos are a life saver :- )))

@satyaprakash2910

I am a beginner starting from yesterday. Your videos are so easy to understand. I am going to watch all videos of your channel.
i started from your beginner's playlist

@nidadursunoglu6663

normally these videos stress me out but your tone is so calming