0

我在编译时收到此错误...“stock.c:103:错误:'stock_t'之前的预期表达式”...我做错了什么吗?

stock_t * createStockHolding(
     char * name, float closing, float opening, int shares, 
     float (* getPrice) (void * S),
     float (* getTotalDollarAmount)(void * S),
     float (* getPercentChange)(void * S),
     char * (* toString)( void * S)) {

        stock_t * newStock = (stock_t*)malloc(sizeOf(stock_t));
        newStock->stockSymbol = name;
        newStock->closingSharePrice = closing;
        newStock->openingSharePrice = opening;
        newStock->numberOfShares = shares;
        newStock->getPrice = getPrice;
        newStock->getTotalDollarAmount = getTotalDollarAmount;
        newStock->getPercentChange = getPercentChange;
        newStock->toString = toString;
        return newStock;
 }      
4

1 回答 1

5

它是 的大写字母sizeOfO。您必须使用sizeof(小o)。

于 2013-04-13T19:33:18.767 回答