I hope someone can help me, I am a beginner, and reading the posts here I am a bit out of my depth. I am trying to pass a string to a function, I have looked at other code examples and I cannot understand why it doesn't work, I am sure I am missing something really basic. Any help anyone could give me will be really appreciated:
#include <stdio.h>
#define SIZE 50
void get_precision(char *s);
int main(void)
{
/* Declare variable */
char PROMPT_2[SIZE]= "Type a number from 1 to 10: ";
get_precision(PROMPT_2);
}
get_precision(char *s)
{
printf ("%s", s);
}