POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: My first C++ program Server Time
30 Sep 2024 21:29:00 EDT (-0400)
  Re: My first C++ program  
From: Mueen Nawaz
Date: 19 Sep 2008 16:15:49
Message: <48d40875$1@news.povray.org>
Orchid XP v8 wrote:
> Spot the mistake:
> 
> int foo(vector<int>& stack)
> {
>   int x = stack.back();
>   stack.pop_back();
> }
> 
> For reasons I can't begin to understand,
> 
> 1. This doesn't produce any compile-time error.
> 
> 2. This function always returns the value "2144912088".

	Function lacks a return statement.

-- 
Inoculatte: To take coffee intravenously when you are running late.


                     /\  /\               /\  /
                    /  \/  \ u e e n     /  \/  a w a z
                        >>>>>>mue### [at] nawazorg<<<<<<
                                    anl


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.