answersLogoWhite

0

What are the differences between puts and fputs?

Updated: 8/11/2023
User Avatar

Payelmisty

Lvl 1
16y ago

Best Answer

All three functions output a single character, either to the console or to a FILE. putc() takes a character argument, and outputs it to the specified FILE. fputc() does exactly the same thing, and differs from putc() in implementation only. Most people use fputc(). putchar() writes the character to the console, and is the same as calling putc(c, stdout). puts() is a multicharacter function and putchar() is single character function

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

The first is an iostream object, the second is a function.

You might ask if there is a similarity between cout an stdout, and fprintf and <<.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

putchar (c) is the same as putc (c, stdout) part of the standard C-rtl, works any platform.

putch is part of the conio.h functionality (MS-DOS direct console I/O), use it if you are using conio.h to handle formatted screens.

This answer is:
User Avatar

User Avatar

Wiki User

16y ago

puts() writes to the stdout device, fputs write to a file device.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

putchar (c) is the same as putc (c, stdout)

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

printf is used for formated output. we can print char , string , number using printf while using putchar we can print only single character.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

puts doesn't do formatting, but it adds a new line. Example:

printf ("These %s are equivalent\n", "two");
puts ("These two are equivalent");

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the differences between puts and fputs?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you display strings?

C: puts, printf, fputs, fprintf, write, fwrite...


Is there equality and justice in our society?

There is still Caste System (social classes) in India and it puts differences between the people.


Write a c program to display hello on the monitor without using printf?

You can choose from puts, fputs, fwrite, write (or even putchar, putc, fputc). I hope this will help you to start.


Is there equality and justice in India?

There is still Caste System (social classes) in India and it puts differences between the people.


A C program to store students record in a file?

#include&lt;stdio.h&gt; void main() { FILE *fp; char name[20],ch; char *roll; fp=fopen("specifies file path","w"); if(fp!=NULL) { do{ printf("input roll_no"); gets(roll); printf("\ninput student name"); gets(name); fputs(roll,fp); fputs("\t",fp); fputs(name,fp); fputs("\n",fp); printf("you want to continue y/n"); ch=getch(); }while(ch=='y'); } }


What are differences between tape and staples?

Tape sticks things together, and staples puts two itty-bity hole in the paper and a metal staple closes and folds


How can we write our name in C programming language without using printf?

You can use fputs() instead of printf().


What are the differences between a Proposer and an Insurer?

A proposer puts something forth for consideration, discussion, or adoption.An insurer is a person or company that underwrites insurance risk. They are the party that pays the compensation in an insurance contract.


What are within group and between group differences?

Within-group differences refer to variations that exist among individuals or data points within the same group or category. This can include differences in characteristics, behaviors, or outcomes within the group. Between-group differences refer to variations that exist between different groups or categories. This can include differences in averages, distributions, or patterns observed when comparing multiple groups.


Which of the following are responsible for the differences between species and for differences between individuals in the same population?

Genetic differences


What are the differences between polycarbohydrate and polysaccharide?

What are the differences between polycarbohydrate and polysaccharide?


Differences between 1950s and now?

differences between now and then 1905s