How to save variable for next start? -C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to save variable for next start? -C

how to save arrays, int ,char etc in any file and load it in next start so that we have our previous data and new data in variable

11th Mar 2018, 10:00 AM
Ahsan Iqbal
Ahsan Iqbal - avatar
9 Answers
+ 4
no but you have to define in your define header file and it will create and in built type data type
11th Mar 2018, 10:05 AM
Yesh Jadav
Yesh Jadav - avatar
+ 4
you can do in your main function of the program
11th Mar 2018, 10:07 AM
Yesh Jadav
Yesh Jadav - avatar
+ 3
there is another way of using those concept by including your own file.h you have to first define the header file and you can use those headers in your program
11th Mar 2018, 10:02 AM
Yesh Jadav
Yesh Jadav - avatar
+ 2
@ahsanIqbal do you have heard about the string.h file
11th Mar 2018, 9:14 PM
Yesh Jadav
Yesh Jadav - avatar
+ 1
i got so far is FILE *f = fopen("some file name. any better ext", "a+");
11th Mar 2018, 10:02 AM
Ahsan Iqbal
Ahsan Iqbal - avatar
+ 1
will it save multidimensional arrary with user input?
11th Mar 2018, 10:04 AM
Ahsan Iqbal
Ahsan Iqbal - avatar
+ 1
hmmm i wanted with user input for my proj :( anyway I'll think of something thanks btw
11th Mar 2018, 10:06 AM
Ahsan Iqbal
Ahsan Iqbal - avatar
+ 1
can you give me an example please
11th Mar 2018, 6:29 PM
Ahsan Iqbal
Ahsan Iqbal - avatar
0
yes string.h n strings.h
12th Mar 2018, 3:03 AM
Ahsan Iqbal
Ahsan Iqbal - avatar