Hmm, I was trying to test the stdin and stdout you talked about and here's what I got:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
	int x[8], i, j, *p;
	p = malloc(sizeof(int) * 8);
	printf("Enter at least 8 integers (press q when done)");
	while( getchar() != 'q')
	{
	for(i = 0; i < strlen(x); i++) fgets(x[i], 15, stdin);
	for(j = 0; j < strlen(x); j++) fputs(x[j], 15, stdout);
	}

	free(p);
	
	getchar();
	return 0;
}
There are a lot of errors:
Code:
untitled.c:12: warning: passing argument 1 of ‘strlen’ from incompatible pointer type
untitled.c:12: warning: passing argument 1 of ‘fgets’ makes pointer from integer without a cast
untitled.c:13: warning: passing argument 1 of ‘strlen’ from incompatible pointer type
untitled.c:13: warning: passing argument 1 of ‘fputs’ makes pointer from integer without a cast
untitled.c:13: warning: passing argument 2 of ‘fputs’ makes pointer from integer without a cast
untitled.c:13: error: too many arguments to function ‘fputs’
What am I doing wrong?

and btw,
for example,
if I do this:
Code:
int x[], *p;
p = malloc(sizeof(int)); // what do I put here? * what?
I mean, what is the malloc parameter if I don't know x's size?