lkml.org 
[lkml]   [1998]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [FIXES] 2.1.125
On Sat, 10 Oct 1998, Adam Sulmicki wrote:

> [btw: can someone explain me why in linux kernel I can't declare var inside of the proc,
> but instead it has to be at beginning of it. I think in 'normal' c programs you can do that]

*bzzzt*

C++ is the language that lets you define variables anywhere. In C they must be defined
at the beginning of the scope. For example:

int main(void)
{
int foo=2;

yadda();
yadda();

/* you can even do ugly stuff like this */
{
int i=0;

while (i++<foo) {
yadda();
}
} /* the scope of 'i' ends here */

yadda();

return 0;
}

--
Matt

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.094 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site