The issue is an "Access violation writing location 0x00000000" error message right after I initialize the bk variable to NULL. My guess is I should reserve memory space in advance to assign NULL ( something like Book bk = new Book(); ) but I have not been able to figure out how to do it in C++ till now.
Book.h
#ifndef Book_H
#define Book_H
struct _book;
typedef _book* Book;
Book CreateBook(unsigned int pageNum);
Book.cpp
#include "Book.h"
#include <iostream>
#ifndef Book_CPP
#define Book_CPP
using namespace std;
struct _book
{
int pageNum;
};
Book CreateBook( unsigned int pageNum){
Book bk = NULL;
bk->pageNum = pageNum;
return bk;
};
typedefto declare pointer types!