D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] C array question



is there a similar notation in C that will fill a certain 
number of 'cells' with a predefined value ?? If there is 
that would be great as the only other way I can see of 
doing it is with loops and I would prefer to avoid that if 
possible !!!!


I don`t know Fortran and I am not the best C programmer around here 
but I would address this problem by knocking up a little home made 
function that iterates over a value passed to it, assigning another.

i.e. call your function like:  assign(4, 5);
to assign the value `5' four times.  The function would consist of a 
for loop with an assignment enclosed. Any good?

MB

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly