Write a few statements that open a file called "greeting", write the message "hey!" to the file -- and then close it. declare an
y variables needed.
2 answers:
C++:
int main () {
std::ofstream output {"greeting.txt"};
output << "hey!";
output.close();
return 0;
}
Answer:
The answer to this question can be given as:
Statement:
FILE *data1; //create file pointer type variable
data1 = fopen("greeting","w"); //open file use fopen function
fprintf(data1,"hey!"); //print message.
fclose(data1); //close file.
Explanation:
The description of the statement can be given as:
- In this statement firstly we define a file pointer type variable that is "data1".This variable holds the file.
- Then we use the fopen() function that is used to open a file. In this function, we pass the file name and the mode to open the file.
- Then we use the fprintf() function this function prints the value of the file.
- In the last, we close the file, for close file we use fclose() function.
You might be interested in
Answer:
.
Explanation:
you do to me on the bottom bar and once you hit that you click the pencil and change it
Answer:
d)"I have a really bad feeling about her. I don't know why."
Explanation:
Answer: here is the answer ☀️keep on shining☀️
Explanation:
there are many styles of coding think about it like art if you had 15 painters working on the same 4x4 painting it would look like a mess.
-scav
Answer:
FALSE ZzZzZzZz
Explanation:
Cus it is PERIOT