c ++ primer plus the sixth edition of Listing 16.8 vect2.cpp Hand-source compiler error! ! !

  Hand adhere to the source, compile and run, but each program were carried out single-step debugging, yesterday started playing in VS2017 c ++ primer plus the sixth edition of the program list after 16.8 vect2.cpp compile error;

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

VS compiler error message:

 1 C2601 "FillReview (Review & rr)": local function definition is illegal;

 2 C2601 "ShowReview (const Review & rr)" local function definition is illegal;

-- 2019/09/26

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Comparative source code found Hand source code block if (num> 3) the lack of "}" will cause "FillReview" "ShowReview" contained in the function main (), so compiler error, the above problems occur! ! !    -- solved

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 Listing 16.7 vect1.cpp need to be added using std :: endl in main () ;, otherwise the compiler run error! ! !

Guess you like

Origin www.cnblogs.com/huhuhusanling/p/11595855.html