I've tried to do it with both fputs() and fwrite() using the escape squence '\n' and eol char '\0'. But nothing is working. Please help. I need to write a 2d char array to a txt file.
Thanks, Dark_Halmut
$fp = fopen("file.txt","w"); for ($i=0;$i<=count($array);$i++) { fwrite($fp,$array[$i]."\n"); } fclose($fp);
This opens a file for writing (and erases it) and then loops through every index in the array and writes it to the file, then closes it.
Yeah that werks. Thanks a bunch. This is the first time my c++ wouldn't werk 1 for 1.