C langauge question
1
Name:
Anonymous
2011-02-08 2:53
int
add(a, b)
int a;
int b;
{
}
Rookie question. What's the benefits of this type of declaration? Also, are there any books that teach this indent style? The GNU C Library seems to make use of it. And so does Julian Assange:
http://ftp.cerias.purdue.edu/pub/tools/unix/scanners/strobe/strobe/strobe.c
2
Name:
Anonymous
2011-02-08 3:08
>>1
are there any books that teach this indent style
lololol
3
Name:
Anonymous
2011-02-08 3:56
More like Jewlian Assange LOL!!!
4
Name:
Anonymous
2011-02-08 4:08
>>1
int
add(a, b)
int a, b;
{
}
YHBT
5
Name:
Anonymous
2011-02-08 4:15
This is the way that functions were declared prior to C89. It is commonly called a "K&R function declaration". You will only see it in old code, or in new code written for an odd platform that still uses an old C compiler. It should not otherwise be used, although it is still valid C for backwards compatibility.
6
Name:
Anonymous
2011-02-08 4:18
>>5
You will only see it
You
should only see it.
7
Name:
Anonymous
2011-02-08 5:06
int
add
(
a, b
)
int a,
int b;
{
return a + b;
}
8
Name:
Anonymous
2011-02-08 8:58
>>7
I remember that style
!
That's the
/prog/ official C style.
9
Name:
Anonymous
2011-02-08 10:29
>>8
Yes. I just adapted it to the K&R style. Notice how the variable names in the parameter list line up with where you declare their types.
10
Name:
Anonymous
2011-02-08 12:13
11
Name:
Anonymous
2011-02-08 13:00
Dubs. Check 'em.
12
Name:
Anonymous
2011-02-08 14:47
>>1
Assange is a bad programmer, who writes messy code with many global vars. No wonder they want to jail him.
int a_timeout = 20;
int a_data_timeout = 30;
char *a_output = NULL;
char *a_services = "strobe.services";
char *a_input = NULL;
/* char *a_prescan = NULL; */
int a_start = 1;
int a_end = 65535;
int a_sock_max = 64;
int a_abort = 0;
int a_bindport = 0;
int a_capture = 1024;
int a_wrap = 79;
int a_lines = 1;
char *a_bindaddr = NULL;
char *a_dircap = NULL;
char *a_views = "all,hosts,networks,ports";
struct in_addr bindaddr;
bool f_linear = 0;
bool f_verbose = 0;
bool f_verbose_stats = 0;
bool f_fast = 0;
bool f_stats = 0;
bool f_quiet = 0;
bool f_delete_dupes = 0;
bool f_minimise = 0;
bool f_dontgetpeername = 0;
bool f_hexdump = 0;
int connects = 0;
int hosts_done = 0;
int attempts_done = 0;
int attempts_outstanding = 0;
struct timeval time_start;
fd_set set_sel_check_r;
fd_set set_sel_check_w;
fd_set set_sel_r;
fd_set set_sel_w;
int host_n;
int Argc;
char **Argv;
FILE *fh_input;
char *capture_buf;
13
Name:
Anonymous
2011-02-08 14:52
Anyway, normal people, like me, use Lisp-style
int
main (int argc
,char **argv
,void *envp)
{printf("Hello, World!");
return 0;}
but really hardcore hackers never use C/C++ at all, they do everything in Lisp.
14
Name:
Anonymous
2011-02-08 14:55
>>13
they do everything in Lisp.
Even trivial things like:
bb:
bb:aa bb:br bb:default-buttsorter bb:foldl bb:m bb:null bb:randomize bb:sub bb:tag?
bb:b bb:code bb:expert bb:foldr bb:make-buttsorter bb:o bb:s bb:sup bb:u
bb:bbcode bb:compose bb:fibonacci-buttsort bb:i bb:map bb:quote bb:spoiler bb:tag bb:verbatim
bb:bbcode
"[b][u][i][o][sup]B[/sup][sub]B[/sub][code]Code[/o] [/i] [/u] [/b] "
(bb:fibonacci-buttsort "FIBONACCI BUTTSORT")
"
F I B O N A C C I B U T T S O R T "
[/code]
15
Name:
VIPPER
2011-02-08 14:56
>>13
hardcore hackers
hackers
To the tanasinn chamber
!
16
Name:
Anonymous
2011-02-08 15:29
>>5
Thank you.
I feel like a kid now.
17
Name:
Anonymous
2011-02-08 15:32
>>7
int
add
(
a, b
)
int a,
int b;
{
return a + b;
}
Updated for expert turkey compliance.
18
Name:
Anonymous
2011-02-08 16:26
>>17
All your instances of
a aren't lined up
19
Name:
VIPPER
2011-02-08 17:06
>>15
Something went seriously wrong with my post.
Disregard
>>15 .
20
Name:
Anonymous
2011-02-08 17:49
21
Name:
Anonymous
2013-04-20 19:33
22
Name:
Anonymous
2013-04-20 23:43
Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?
Mail me at jeremiahgoldstein@hotmail.com
25$ a pop
Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?
Mail me at jeremiahgoldstein@hotmail.com
25$ a pop
Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?
Mail me at jeremiahgoldstein@hotmail.com
25$ a pop