File:  [MW Coherent from dump] / coherent / d / usr / src / examples / printf.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:38 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

void demo_r(string)
char *string;
{
	printf("%r\n", (char **)&string);
}

main()
{
	extern void demo_r();
	int precision = 1;
	int integer = 10;
	float decimal = 2.75;
	double bigdec = 27590.21;
	char letter = 'K';
	char buffer[20];

	strcpy (buffer, "This is a string.\n");

	printf("This is an int:   %d\n", integer);
	printf("This is a float:  %f\n", decimal);
	printf("Another float:    %3.*f\n", precision, decimal);
	printf("This is a double: %lf\n", bigdec);
	printf("This is a char:   %c\n", letter);
	printf("%s", buffer);
	printf("%s\n", "This is also a string.");

	demo_r("Print everything: %d %f %lf %c",
		integer, decimal, bigdec, letter);
}



unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.