Re: function
- From: "Joachim Schmitz" <nospam.jojo@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 31 May 2008 17:14:59 +0200
Bill Cunningham wrote:
"Joachim Schmitz" <nospam.jojo@xxxxxxxxxxxxxxxxxx> wrote in messageJep 8-) Why reinventing the wheel...
news:g1rpes$mp7$1@xxxxxxxxxxxx
[OT]
dd if=/dev/zero of=<your file> count=<your size>
[/OT]
Ah. The easy way out :)
It's not just that, it also is the nul character, a byte with all bits#include <stdio.h>char a = '\0';
#include <stdlib.h>
int
main (int argc, char *argv[])
{
if (argc != 3)
{
puts ("usage error");
exit (EXIT_FAILURE);
}
char a = '0';
Why the termination string character?
unset.
Do you mean to replace myReplacing. Do you want zeros in the file or the ascii representation of the
line or are you adding one?
charcter 0? I believe the earlier.
Yep, left as an excercise to the reader 8-)int b, num;
FILE *fp;
num = atoi (argv[2]);
fp = fopen (argv[1], "wb");
I am thinking that I would need a for loop involved here
somewhere. I am not sure what to put in the body.
while (num--)
fputc(a, fp);
fclose(fp);
return 0;
}
Still needs some error checking (num>=0, fp != NULL, fclose and fput
worked)
I can get that part. I think.
BillBye, Jojo
.
- Follow-Ups:
- Re: function
- From: Bill Cunningham
- Re: function
- References:
- function
- From: Bill Cunningham
- Re: function
- From: Joachim Schmitz
- Re: function
- From: Bill Cunningham
- function
- Prev by Date: Re: function
- Next by Date: Re: function
- Previous by thread: Re: function
- Next by thread: Re: function
- Index(es):
Relevant Pages
|