Re: basic function tell an function

Dan Ritter <[email protected]>
Newsgroups gmane.linux.debian.user
Message-ID <[email protected]>
Jean-Christophe wrote: 
> $ g++ -std=c++23 test-fonction.cpp -o test-fonction.out
> 
> $ ./test-fonction.out 
> File created successfully!
> 
> chocolat
> chocolat 25ans
> chocolat a environ 100 bandes-dessinées.
> 1
> 
> $ file my_file.txt 
> my_file.txt: empty


In main, you called fonction_deux, so it ran and created a file.

At no point inside fonction_deux did you write any characters or
strings to the file handle.

When it closed, it had no data in it, so the file is empty.

-dsr-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.