Calculate.h file not found in Xcode -


i'm learning how use xcode , i'm using book called "beginning max os x programming". i'm working on 1 of first exercises. , told me save c file called "calculate.h" in same file main.c , calculate.c. right away, debugger giving me error saying "calculate.h file not found."

here's code main.c:

#include <stdio.h> #include <stdlib.h> #include <calculate.h>   int main (int argc, const char * argv[]) { int a, b, count, answer; char op;  // pringt prompt printf("enter expression: ");  // expression count = scanf("%d %c %d", &a, &op, &b); if (count !=3)  {     printf("bad expression\n");     return 1; }  // perform computation answer = calculate(a, b, op);   // prin answer printf("%d %c %d = %d\n", a, op, b, answer);  return 0; } 

here code calculate.h:

int calculate(int a, int b, char operator); 

here code calculate.c:

#include <stdio.h> #include <stdlib.h>  int calculate(int a, int b, char operator) { int result;  switch (operator) {         case '+':             result = + b;             break;         case '-':             result = - b;             break;         default:             printf("unknown operator: %c\n", operator);             exit(1); }  return result; } 

try using import "calculate.h" (note "" instead of <>)


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -