hey guys, i got to show up. But the problem i'm having now is the way the text shows.
I'm trying to have it where the new text document thats made is neater like this:
4444444444
333333*333
222*222222
1111*11111
but it looks like this instead
*******4444444444[][[][][][][][]********333333*333[][][][][[][]
**********222*222222*******[][][][][][][][]
****1111*11111[][][][][][[]
I'm trying to figure out why its not formatted correctly and why there are extra astericks.
I've changed my code. my getInput method is what was changed all together.
Code:
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int Input(int row, int col);
void output(int answer[][16],int count);
int main(void)
{
int answer[100][16];
int count, row, col;
count=Input(row, col);
output(answer,count);
return 0;
}
int Input(int row, int col)
{
char c;
row = 0;
col = 0;
while (scanf("%c", &c) != EOF)
{
if(c == '\n')
{
row++;
col = 0;
printf("\n");
}
if(row >=1)
{
if(col >=30 && col <=48)
{
if(c != ' ')
{
printf("%c",c);
}
}
else if(col >= 49)
{
printf("\n");
}
else
{
printf("*");
}
}
col++;
}
return 0;
}
void output(int answer[][16],int count)
{
int i,j;
for (i=0;i<count;i++)
{
for (j=0;j<16;j++)
printf("%d",answer[i][j]);
printf("\n\n");
}
}
Any more help would still be appreciative!