From -5340352229490116898 X-Google-Language: ENGLISH,ASCII X-Google-Thread: f78e5,972722ed514d508a,start X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2001-07-26 14:13:00 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: jdaniel.garcia@terra.es (J. Daniel Garcia Sanchez) Newsgroups: comp.std.c++ Subject: try block as main block of a function Date: Thu, 26 Jul 2001 21:12:40 GMT Organization: Clientes_Teleline Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: <3b6061b5.1188820@news.terra.es> X-Trace: mail2news.demon.co.uk 996181964 mail2news:28458 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-Newsreader: Forte Free Agent 1.21/32.243 NNTP-Posting-Date: Thu, 26 Jul 2001 21:25:18 MET DST Lines: 35 Xref: archiver1.google.com comp.std.c++:6751 Could anybody tell me if this is legal ? void f() try { do_something(); } catch (...) { handle_my_errors(); } Or should I write? void f() { try { do_something(); } catch (...) { handle_my_errors(); } } I've seen the former in a book, but my compiler (MSVC++ 6.0) only accepts the latter. Regards -- Daniel Garc�a --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.research.att.com/~austern/csc/faq.html ]