- 0
[C++] carriage return with fputs()?
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By eiffel_g · Posted
Funny, but I didn't had the issue. All PC's at work are Dell and we had the culprit version of Support Assist for about 2 weeks until we got the new one. No problem at all. And for checking you can also use Dell Command Update, no need to search in windows settings. Just check the Upgrade History. -
By margrave · Posted
YES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -
By AnalystDan · Posted
Apple are scared of their customers! They have built a brand over the years of "it just works out of the box", but that slows innovation. Samsung's master stroke was the Galaxy Ultra: "Let's cram everything into one handset, make it so stupid only real nerds will love it, some of the features will work, some won't, but the audience will have such a high tolerance they won't care". Apple has no such device and so they are constantly worrying these days about the fallout of creating a new experience that customers might not like. I know it is often cited the reason they don't build a touchscreen Mac Book is they don't want to cannibalise the the iPad market, but I think it's equally cold feet after the criticism Microsoft receive trying to make a touch compatible desktop OS -
By Copernic · Posted
HandBrake 1.11.2 by Razvan Serea HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows. Handbrake can process most common multimedia files and any DVD or BluRay sources that do not contain any kind of copy protection. Here is a detailed breakdown of HandBrake’s features: Built-in Device Presets—Get started with HandBrake in seconds by choosing a profile optimized for your device, or choose a universal profile for standard or high quality conversions. Simple, easy, fast. For those that want more choice, tweak many basic and advanced options to improve your encodes. Supported Input Sources—Handbrake can process most common multimedia files and any DVD or Blu-ray sources that do not contain any kind of copy protection. Outputs: File Containers: .MP4(.M4V) and .MKV Video Encoders: H.265 (x265 and QuickSync), H.264(x264 and QuickSync), H.265 MPEG-4 and MPEG-2, VP8 and Theora Audio Encoders: AAC / HE-AAC, MP3, Flac, AC3, or Vorbis Audio Pass-thru: AC-3, E-AC3, DTS, DTS-HD, TrueHD, AAC and MP3 tracks Additional features: Title/ Chapter Selection Queue up Multiple Encodes Chapter Markers Subtitles (VobSub, Closed Captions CEA-608, SSA, SRT) Constant Quality or Average BitRate Video Encoding Support for VFR, CFR and VFR Video Filters—Deinterlacing, Decomb, Detelecine, Deblock, Grayscale, Cropping and Scaling Live Video Preview HandBrake 1.11.2 changelog: All platforms Video Fixed a crash that happened when doing a 2-pass lossless x265 encode Fixed a memory leak that happened when doing a 2-pass MPEG-4/MPEG-2/VP9/FFV1 encode Audio Updated the list of supported dithers and encoders combinations Fixed the Core Audio AAC encoder 7.1 channel layout Subtitles Fixed the VobSub palette creation in the MP4 container Build system Improved build system compatibility with older build tools Third-party libraries FFmpeg 8.0.2 (decoding and filters) SVT-AV1 4.1.0 (AV1 video encoding) Linux Added WebM MIME type to the list of the supported formats Mac Improved handling of unsupported presets Updated Sparkle automatic update library Windows Improved handling of unsupported presets Improved queue low space pause behaviour Fixed the automatic audio track name generation Fixed the summary description of HDR video Download: HandBrake 64-bit | Portable 64-bit | ~30.0 (Open Source) Download: HandBrake ARM64 | Portable Links: HandBrake Website | Other Operating Systems | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware -
By grunger106 · Posted
So, an article that has nothing to do with Windows 11, still gets Windows 11 in the title and a build number as the picture? Dell have a buggy build of Support Assist HP have UEFI settings that need unlocking for the secureboot cert upgrade to take place.
-
-
Recent Achievements
-
DJC50PLUS earned a badge
One Month Later
-
DJC50PLUS earned a badge
Week One Done
-
Eric Biran went up a rank
Proficient
-
Conjor earned a badge
Dedicated
-
Windows Guy earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
The Teej
Okay, it's 2am, and I'm at my wits end.
I'm trying to output a bunch of variables to a file, with 2 numbers and a carriage return on each line.
I have two global int arrays declared all with variables in them.
void FileOutput() { FILE *f = fopen ("myfile.txt", "wb"); if (f == NULL) die("Couldn't open myfile.txt for writing, sorry"); else { int x; char temp_string[20]; for (x = 0; x <= 4; x++) { sprintf(temp_string, "%i %i \n", x_pos[x], y_pos[x]); //printf("%i %i", x_pos[0], y_pos[0]); printf("Calm down sir, PLEASE\n"); fputs (temp_string, f); } fclose(f); } printf("Don't worry sir, I'm from the internet\n"); }Now, it puts it in the file fine, however, it all comes out as one line. The output on the screen comes out fine and I get carriage returns as expected there, however. I'd like it to come out this like this:
82 103
49 134
953 535
354 53
3535 234
The variables are purely aribtrary, this is an extension of a tutorial I'm following (I'm doing Wii homebrew development). I have to say, I've been doing programming for a while, and yet, I've never come across an issue quite like this that I haven't been able to resolve so easily.
Shoving \n everywhere does nothing (in regards to file output). I've tried injecting it when doing fputs() and also at the sprintf part, neither work. Honestly running out of ideas here. Anyone able to give me a hand figuring out what I'm doing wrong here?
Major thanks in advance.
Link to comment
https://www.neowin.net/forum/topic/997904-c-carriage-return-with-fputs/Share on other sites
14 answers to this question
Recommended Posts