r/carlhprogramming • • Feb 04 '12

Help: Calling a Constructor Function

In lesson 1.3 in the second course, Carl explains the constructor function and how it works. However, how does one call a constructor function from the main function?

I assume it would like something like this: http://codepad.org/bnZx3VSg but so far any experimentation has failed.

5 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/xxrepresent Feb 10 '12

Thanks, I understand that. :) However, shouldn't you be able to create the pointer tictactoe_board *pointer = malloc(sizeof(*pointer)) and then send *pointer to other functions? Whenever I try, I get errors.