🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #292

Functions having return(e) AND return.

#292
From: Stephen J. Muir
Date: Thu, 21 Aug 1986 10:23
21 lines
1033 bytes
The compiler doesn't complain that function "answer" can return no result.

# include <stream.h>

int	answer (int a)
{	if (a)
		return (1);
}

main ()
{	int	x;
	cin >> x;
	cout << answer (x);
}

C++ version 1.1, BSD 4.2, DEC VAX-11/750.
-- 
EMAIL:	stephen@comp.lancs.ac.uk	| Post: University of Lancaster,
UUCP:	...!mcvax!ukc!dcl-cs!stephen	|	Department of Computing,
Phone:	+44 524 65201 Ext. 4120		|	Bailrigg, Lancaster, UK.
Project:Alvey ECLIPSE Distribution	|	LA1 4YR
Technical Details
Message-ID: <383@comp.lancs.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!stephen

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!stephen
From: stephen@comp.lancs.ac.uk (Stephen J. Muir)
Newsgroups: net.lang.c++
Subject: Functions having return(e) AND return.
Message-ID: <383@comp.lancs.ac.uk>
Date: Thu, 21-Aug-86 06:23:14 EDT
Article-I.D.: comp.383
Posted: Thu Aug 21 06:23:14 1986
Date-Received: Fri, 22-Aug-86 06:47:28 EDT
Reply-To: stephen@comp.lancs.ac.uk (Stephen J. Muir)
Organization: Department of Computing at Lancaster University, UK.
Lines: 21