Right ive sorted it-well kind of. The problem now is that unless the return key is pressed at the end of a line, the words per line continues to count unless return has been pressed. This means that...
Type: Posts; User: bigpmc
Right ive sorted it-well kind of. The problem now is that unless the return key is pressed at the end of a line, the words per line continues to count unless return has been pressed. This means that...
Ok i now realise i have to create a new variable-say int words_per_line and assign that to max if it is bigger with each line. But my question now is that in the code i have, how do i take it on a...
Thank you, still cant seem to get most words per line working though-i know its something simple and i think its something i know i should be able to do which is why it is so annoying
ok so what if i did leave main at say void. What would that mean? Im new to C++ as i used to use java.
Im trying to write a program that reads from a text file and then outputs the total words, most words per line, total bumber of lines and average words per line. The problem is that ive got a total...
#include <iostream>
#include <fstream>
#include <strstream>
#include <string>
using namespace std;
Thanks for your help got it working, another point to note is that i missed the break statement at the end of each case so when a number 1 occured it also added to 2 and 3
void main(int argc, char **argv[]) {
int equals1 = 0;
int equals2 = 0;
int equals3 = 0;
cout << "Enter a list of integers, that terminates with a letter (e.g. 1 2 3 4 k)" << endl;
int...
Sorted it all out now thanks to all your help and a bit of experimenting. Thanks a lot for all your input, and i will try to return the favour to others if i can.
Thank you all so much,
Paul
Oh one more thing, bear with me im new to C++ , when i want to call the function, do i do it from my main.cpp or from the place where i wrote the Copy method?
Thanks for all your replies, im using Visual Studio . net 2003, so as i thought its a simple thing-i havent actually called the method lol
Thanks a lot and ill let you know if your suggestions work....
ha thanks-i edited the message now-got a bit confused, hope the format is ok for you guys now
This is my first post on a problem thats driving me slowly mad so here goes. What im trying to do is to write a method that takes 2 char parameters called filenameIn and filenameOut, so that i can...