+ 1

A question regarding file reading in c++

So i wanted to design a program in which i could read the below mentioned text. A john does his homework 20 This text is stored in a .txt file.Now lets say i had a char a another string b and an integer c I want char a='a' string b="john does his homework" integer c=20 How do i do this?Any help will be appreciated since i am very new to file reading and i am struggling with it.Thanks

2nd Jan 2021, 2:41 PM
Dex
Dex - avatar
4 Respostas
+ 2
no i dont speak arabic
2nd Jan 2021, 2:56 PM
Dex
Dex - avatar
+ 1
i just wanna store data in these variables which is taken from a file and then display it.I have given the format of how the data is present in the .txt file and how i wish to store it
2nd Jan 2021, 2:46 PM
Dex
Dex - avatar
+ 1
ok so i cant message u in private since my level isnt high enough.So i will explain it as well as i can here My requirement is this that i have a text file with this text in it A John does his homework 30 Now i want the program to read this file and then store data in a char string and an integer.which i can later display by cout. lets say the programs assigns char a='A' string str="John does his homework" and an integer c the value of 30 which i can later display if i wish
2nd Jan 2021, 2:54 PM
Dex
Dex - avatar
+ 1
thanks
2nd Jan 2021, 3:03 PM
Dex
Dex - avatar