jeudi 4 avril 2019

C - Choose random string from file

For homework, i am coding database of employees in C with some functions. I am nearly done and i have done some bonuses but i would like to do one more. At beginning i generate random employees(using structs) but their names are only random "chars".

I would like to choose random name but i would like to avoid big array of names because i dont think its so good. I want use names.txt file with names and choose random name from this file. If you have any different idea of choosing random real name, you are welcome.

I am not posting code because i have problem only in this part of choosing name and i dont have anything in this small part right now.

I have tried something but only thing i can is print or save "chars" from this file but i need only specific random string.




Aucun commentaire:

Enregistrer un commentaire