Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
my_params_in_list.c
SUBMITTED BY:
Guest
DATE:
Nov. 29, 2013, 6:29 p.m.
FORMAT:
C#
SIZE:
546 Bytes
Raw
Download
Tweet
HITS:
4481
Go to comments
Report
t_list
*
my_params_in_list
(
int
ac
,
char
**
av
)
{
int
nb
;
struct
s_list
*
list
;
nb
=
0
;
list
=
NULL
;
while
(
nb
<
ac
)
{
my_put_in_list
(
&
list
,
av
[
nb
]);
nb
=
nb
+
1
;
}
return
(
list
);
}
int
my_put_in_list
(
struct
s_list
**
list
,
void
*
data
)
{
struct
s_list
*
elem
;
elem
=
malloc
(
sizeof
(
*
elem
));
if
(
elem
==
NULL
)
return
(
1
);
elem
->
data
=
data
;
elem
->
next
=
*
list
;
*
list
=
elem
;
return
(
0
);
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus