Hey, i'm new here and hoping to get a few noobish questions answered
Hi everyone. Basically i want to be good at c programming. But everytime i start to get into it. I get frustrated that i cant do something i want to do and end up leaving it. Hopefully with your help i can get these questions answered.
So just for a start ive got a few random questions.
1) if you have a struct with a variable like char *name; in it. Can you assign it a value by doing structname->name = "myname"; or is that wrong? Do you have to malloc it some space first?
2) Some source code i look at keeps talking about HANDLE - what is this and what is it used for?
3) How can you use strtok to split a string into an array? ive seen different example but i cant understand most of them.
A program im trying to make at the minute is a gym program. Which uses a weight lifting routine of 3 exercises
bench press, squat and power clean.
I wanted the program when it was first run to detect the date and store it somewhere permanent that it could access when its run again.
I was looking it to realise when it was run a second time, that it had run before and compare the date now, to the date when it was first run. Then count how many weeks the program had started and add the right amount of weights to the lift
so to summerise.
Make the program know its been run before.
Make it be able to calculate how many weeks since it was first run - using difftime().
Also wanted to store the previous lifts in a file. But ive not idea how to effectively pick correct data from a file. i.e how to find the number and how to save it as an int.
sorry if this is too many questions or unclear. But these things have been bugging me and i really want to understand it all.