Hi need help T_T

can u help me do a program that will input a word, then find a word in every line in the textfile, then count every word that match. TT
sure, check out
#include <fstream>

regards
is it posible to cin every word in a line ?
example

this line is example
i will get all the words the store it in a variable??? using fstream??
http://www.cplusplus.com/doc/tutorial/files/

read the "Text files" article carefully
okie thankyou very much
you're welcome
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
help can u fix this for me


// dang.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{

	string word;
	char find[1000];
	int count=0;
	int i=1;
	cout<<"search"
		<<"enter word to count:";
	cin>> word;


	fstream file;
	file.open("dang.txt");
	if(file.fail()){cout<<"failed to initialize";}
	else while(!file.eof())
			{
				cin>>find[i];// i cannot get all the words one by on in sentence
				if(find==word){count=count+1;}
				i++;
			}

	cout << count;
	return 0;
}
Topic archived. No new replies allowed.