ah yes, it idd solved it. but i now understand why the move of fclose resolved it.
thank you for your explanation gwarf420.
Type: Posts; User: brabo
ah yes, it idd solved it. but i now understand why the move of fclose resolved it.
thank you for your explanation gwarf420.
any non-existent filename gives the segmentation fault error.
the output is as shown in my first post.
Could not open file
[1] 13302 segmentation fault (core dumped)
please bear with me.
why was the file not opened correctly and how did moving up fclose() solve that?
grtz,
brabo.
is that because it was outside the curly brackets in which the variable 'file was declared?
grtz,
brabo
i have a problem with the example program in the beginners C 'Command Line Arguments' tutorial.
i have the code exactly as is provided on the page. compile with gcc with no errors.
the code works...