just the words but I am getting errors

#include<stdio.h>
#include<conio.h>

void main()
{
	FILE *f1;
	char c='y', field[10][10];
	int i=0, j=0;
	printf("Fields:- \n");
	f1 = fopen("filename","r");
	while ((c=getc(f1))!='\r')
	{
		while (c!='\t')
		{
			field[i][j] = c;
			j++;
			c=getc(f1);
		}
		c='y';
		printf("%s ",field[i]);
		i++;
	}
	printf("i = %d, j = %d", i, j);
	fclose(f1);
}

Recommended Answers

All 2 Replies

1. Please use code tags.
2. What errors are you getting?

This looks like C not C++, or you sure you posted in the correct forum? If yes:
- Use std::strings
- Use ifstream
- Use getline()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.