c - Replacing stdin within a piece of code -


i have piece of code uses stdin. when run program command-line pass location of wav file i.e. /users/username/desktop/music.wav.

the code written in c. stdin variable runs throughout 2 functions.

how replace stdin within code input of file directory , location?

in other words, how hard code '/users/username/desktop/music.wav' 2 different c functions.

i think looking freopen.

if understand correctly, read filename argv[1] , call freopen():

freopen(argv[1], "r", stdin); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -