How to use fputc() to write characters to stdout in C

1 Answer

0 votes
#include <stdio.h>

int main(void)
{
	char str[] = "C Programming\n";
	char* p;

	p = str;

	// int fputc(int c, FILE * stream);

	while ((*p != '\0') && fputc(*(p++), stdout) != EOF);

	return 0;
}




/*
run:

C Programming

*/


 

 



answered Apr 27, 2024 by avibootz
edited Apr 27, 2024 by avibootz

Related questions

1 answer 217 views
1 answer 237 views
1 answer 98 views
98 views asked Feb 4, 2023 by avibootz
2 answers 240 views
240 views asked Jul 14, 2020 by avibootz
1 answer 110 views
...