0

ok, NEED HELP HERE TO GET ALL THE CHARACTERS IN THE TEXT FILE AS A FULL LENGTH AND DO SOMETHING WITH IT... Line 31

#include "stdafx.h"
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <fstream>

#ifndef _DEPRECATION_DISABLE   /* One time only */
#define _DEPRECATION_DISABLE   /* Disable deprecation true */
#if (_MSC_VER >= 1400)         /* Check version */
#pragma warning(disable: 4996) /* Disable deprecation */
#endif /* #if defined(NMEA_WIN) && (_MSC_VER >= 1400) */
#endif

#define TEXTMAX 99999//maximum text length
#define WORDMAX 20//maximum word length
using namespace std;

void main()
{

nd *list = NULL, *tempPointer = NULL;
char text[TEXTMAX], word[WORDMAX];
int textLength=0, i, tempIndex = 0, count=0;

std::ifstream in("textfile.txt");

//NEED HELP HERE TO GET ALL THE CHARACTERS IN THE TEXT FILE AS A FULL LENGTH AND DO SOMETHING WITH IT...

gets(text); 
textLength = strlen(text);//get the length of the text
//..
//..
//..DO WATEVER...

Edited by VUEKID

2
Contributors
3
Replies
11
Views
4 Years
Discussion Span
Last Post by tinstaafl
0

I need to read a text file, i.e. "hello world, how are you doin" line 31.

i need to output it to the console as characters of "text" so i can grab it.

gets(text);
textLength = strlen(text);

Edited by VUEKID

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.