He loses the char from the first function, so it won't print in the second one, also.
Code:
#include<stdio.h>
void fun (char *,float); /* the FUNCTION PROTOTYPE */
void fun2 (char, float);
int main(void)
{
float a;
char c;
printf("Please enter a number: "); /* Program in MAIN */
scanf("%f",&a);
fun(&c,a);
printf("\nBack in main.");
printf("\n\nThat 's the end of this lab.");
getchar();
return 0;
}
void fun (char *c,float x ) /* Function Header/Definition – NO semicolon */
{
printf("\nFirst function");
printf("\n\nThe number you entered is %4.2f.",x);
printf("\n\nPlease enter a character: ");
scanf(" %c",c);
getchar();
fun2(*c,x);
}
void fun2(char c, float x)
{
printf("\n\nSecond function.");
printf("The numer you entered is %4.2f.",x);
printf("\n\nThe character you have entered is %c",c);
getchar();
}
That's one way.