I'm getting an error. Here's my info from Terminal
:
make: *** [tests/myFunction] Error 1
~/workspace/ $ make ./tests/myFunction
clang -fsanitize=integer -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wshadow tests/myFunction.c -lcrypt -lcs50 -lm -o tests/myFunction
tests/myFunction.c:7:5: error: implicit declaration of function 'PrintName' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
PrintName(s);
^
The code I used is:
#include <cs50.h>
#include <stdio.h>
int main(void)
{
string s = get_string();
PrintName(s);
}
void PrintName(string name)
{
printf("hello, %s\n", name);
}
The code I used is from here:
http://docs.cs50.net/2016/fall/notes/1/week1.html
Please, help to fix an error.
PrintName
comes aftermain
, meaning that when the program enters main, it doesn't really know the existence of PrintName. There are two possible fixes to that sort of error, but I am not going to give it out.