Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
How does a semicolon cause a syntax error?
This is the error:
array.cpp(49): error C2059: syntax error : ';'
And this is the line of code it came from:
reg = s.default_value_*;
When I put parentheses around the default_value_* part, I get
syntax error : '('
instead. Any ideas?
default_value_ is an std::auto_ptr and I am trying to assign the value of its object to reg, a variable. according to http://www.cplusplus.com/reference/std/memory/auto... the * operation "Returns a reference to the value pointed by the auto_ptr object."
1 Answer
- oopsLv 61 decade agoFavorite Answer
A semi-colon is used to complete a statement, and this:
reg = s.default_value_*;
is an incomplete statement.
What exactly are you trying to do there?
Edit:
operator*, when used as a unary operator, is a prefix operator.
reg = *s.default_value_;