Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code is not working use printf() instead of fprintf() no input or output #include #pragma warning(disable : 4996) int main(void) { //open a file. if

Code is not working

use printf() instead of fprintf()

no input or output

#include #pragma warning(disable : 4996)

int main(void) { //open a file. if its not present it will be created FILE* f = fopen("file1.txt", "w"); //adding text to file fprintf(f, "This is first line This is second line."); //open a file. if its not present it will be created binary modr FILE*f =fopen("file2", "wb"); const unsigned short kBinaryData[] = { 26946, 24942, 31090,25632, 29793,8289, 28518, 8306, 28537, 33141,39308 }; //append all elements into file for (int i = 0; i

output Example:

image text in transcribed
oil. C:\\Windows\\System32\\cmd.exe 0 X Microsoft Windows [Version 10.0.19042.1288] (c) Microsoft Corporation. All rights reserved. myBinaryFile.data - Notepad 0 X C: \\Users \\abdim\\Downloads>f7Sample. exe File Edit Format View Help Binary data for you A C: \\Users \\abdim\\Downloads> C: \\Users \\abdim\\Downloads> C: \\Users \\abdim\\Downloads> C: \\Users \\abdim\\Downloads> C: \\Users \\abdim\\Downloads> C: \\Users\\abdim\\Downloads> C: \\Users \\abdim \\Downloads> C: \\Users \\abdim\\Downloads> Ln 1, Col 23 100% Windows (CRLF) ANSI myTextFile.txt - Notepad X File Edit Format View Help This is the first line. A This is the second line. Ln 1, Col 1 100% Windows (CRLF) UTF-8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions