I'm trying to fill a string with the name of a file stored in a "fake memory" vector. Assuming I have a start pointer that directs me to the beginning of the string in my memory and I know the string completes with a NULL, how do I do this? My final goal is to access a file whose file name I have just stored in a string. Here is my general process flow:
- fill vector with data from a binary file.
- a pointer to the file name string contained in my vector is given to me
- starting at that pointer position in the array, get each character and store them in a string variable until I hit NULL
- use string variable to access file using fopen and then scanf
*I am implementing a very simple syscall emulation for a processor I designed in Verilog.
This is a bit above me at the moment so any help would be appreciated.
Thanks,
~DS