Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Re: Re: using strict and functions

by talexb (Canon)
on Jan 18, 2002 at 07:14 UTC ( #139727=note: print w/replies, xml ) Need Help??

in reply to Re: Re: using strict and functions
in thread using strict and functions

Hmm...I think you meant to say C++ here. C doesn't give you that kind of flexibility; however, C++ does.
#include <stdio.h> int main ( int iArgC, char * apsqArgV[] ) { printf ( "Hello, world! This is cygwqin speaking.\n" ); { char szMsg[] = "Not so!"; printf ( "Now inside scope, msg is %s.\n", szMsg ); } return ( 0 ); // Success is zero in Windows. }
This is the kind of scope that I was talking about. The char array szMsg is declared at the start of the scope; this code compiles and runs correctly under CygWin (Win98).

You may have been talking about the following:

void FooBar ( void ) { int iBeer, iVodka; float fCredit = 20.0; .. /* Code here */ iBeer++; fCredit -= 2.50; .. /* More code */ char *apszVarious[]; /* ILLEGAL in C */ }
I will grant that this kind of variable declaration is valid in Perl but not valid in C.

--t. alex

"Of course, you realize that this means war." -- Bugs Bunny.

Replies are listed 'Best First'.
Re: Re: Re: Re: using strict and functions
by IlyaM (Parson) on Jan 18, 2002 at 08:36 UTC
    When I have been studying C it was illegal C code. Well, it was long time ago. Maybe standart have been changed. Or it is just a gcc extension to C (gcc has plenty of them).

    BTW function prototypes was not always part of C. IIRC some time ago you had to rewrite it as:

    #include <stdio.h> int main ( iArgC, apsqArgV ) int iArgC; char * apsqArgV[]; { char szMsg[] = "Not so!"; printf ( "Hello, world! This is cygwqin speaking.\n" ); { printf ( "Now inside scope, msg is %s.\n", szMsg ); } return ( 0 ); // Success is zero in Windows. }

    Ilya Martynov (

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://139727]
choroba waves
[Mj1234]: Hello Monks, I have installed Active perl 5.16 and 5.14 but I dont find Devel::GDB package when I try to install through ppm
[Discipulus]: i'v installed ubuntu 16.04lts and i'm quite disappointed: is deadly simmilar to new win osses where you cannot find even simple things...
[Corion]: Hi Discipulus ;)
[Corion]: Mj1234: Maybe Ubuntu didn't package Devel::GDB? In that case, consider using local::lib and install the module from CPAN
[Corion]: But a quick Google search turns up this page, which seems to suggest that it should be packaged
[Discipulus]: iirc active perl has repositories only for last 2 o 3 major release of perl Mj1234. I strongly suggest portable version of strawberry perl and use cpan client to install modules
[choroba]: Also, who needs GDB when there's hdb?

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2016-12-07 08:53 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (125 votes). Check out past polls.