Wrapping my head around this subject. I am adding to it and then including the malloc that I am learning as I build this test app. This works if I use a DOT operator 'myNewNum->number = 5;' but not the -> I thought I could pick the '.' or '->' but I am getting an "invalid type argument"?
header file
main.c
header file
Code:
struct theNumber {
int number;
};
Code:
#include <stdio.h>
#include"header_test.h"
int main (int argc, const char * argv[]) {
struct theNumber myNewNum;
myNewNum->number = 5;
printf("My number is: %d",myNewNum->number);
return 0;
}