- May 12, 2001
- 6,960
- 7
- 81
I'm confused on what for (;; ) just like that with no variables does... what does that do?
Also those voids are also throwing me off... any clues? Running it in the compiler with checks really hasn't helped me figure out whats going on =/
#include <stdio.h>
int main(int argc, char **argv) //declares an int argc, and a 2 dimensional char array argv
{
if (argc <= 1)
{
for (;
{
(void) putchar('y');
(void) putchar('\n');
}
}
else
{
for (;
{
int i;
for (i = 1; i < argc; i++)
{
if (i > 1)
(void) putchar(' ');
(void) fputs(argv, stdout);
}
(void) putchar('\n');
}
}
return (0);
}
Also those voids are also throwing me off... any clues? Running it in the compiler with checks really hasn't helped me figure out whats going on =/
#include <stdio.h>
int main(int argc, char **argv) //declares an int argc, and a 2 dimensional char array argv
{
if (argc <= 1)
{
for (;
{
(void) putchar('y');
(void) putchar('\n');
}
}
else
{
for (;
{
int i;
for (i = 1; i < argc; i++)
{
if (i > 1)
(void) putchar(' ');
(void) fputs(argv, stdout);
}
(void) putchar('\n');
}
}
return (0);
}