samedi 28 février 2015

C Programming - Split a file content or a string to an array of string of the SAME size

I need an advice about C programming. I need to split a file (or its content) to an array of char. I found all over the internet different solutions to either split a file to different smaller files or split a string to an array but using delimiters with strtok()


The thing is : I need to split it et store it into an array of char but each elements must have the same siwe (64 bits)


Do you guys have any idea how I can do it ( Using the standard C library ) ? Any advices would be greatly appreciated.


TO be clearer : I managed to split a file into several smallers files of the same size example :


Zeddis@localhost $> ls -la -rw-rw-r--. 1 Zeddis Zeddis 64 28 févr. 23:17 filepart_number_10 -rw-rw-r--. 1 Zeddis Zeddis 64 28 févr. 23:17 filepart_number_11 -rw-rw-r--. 1 Zeddis Zeddis 64 28 févr. 23:17 filepart_number_12 [...]


but I need to store the content into an array, not files and each element's size has to be 64.


lets say I have a 2mb .txt file, I need to store its content to an array zhere its element's size is 64 bits.


I hope you understood since english is not my native language.


thanks in advance, Regards,


Aucun commentaire:

Enregistrer un commentaire