mercredi 28 août 2019

How to pass time_t by reference into a function

I have a function definition like this:

double getPriceTimeByPtr(const StrategyParams* ptr, const int applied_price, const int timeframe, const int shift, const int shift_delta, const bool normalized, time_t &time);

but when I compile this code it errors just before the &time part so clearly there is a problem passing a time_t object by reference.

How do I fix this please?

I recently added the time_t parameter to the function and the error occurred since then.

Here's the errors generated:

Severity    Code    Description Project File    Line    Suppression 
State
Error   C2143   syntax error: missing ')' before '&'        
Error   C2143   syntax error: missing '{' before '&'        
Error   C2059   syntax error: '&'   
Error   C2059   syntax error: ')'       

The syntax seems correct to me but the compiler doesn't like it.

Aucun commentaire:

Enregistrer un commentaire