Hello all, I wanted to try out the cstrings and decided to use them with File I/O in c++. I want to fill a c-string array with text and then print out how many spaces, vowels, uppercase letters, lowercase letters. But before I can do any of that my file only fills the array with the last word from the statement.
the statment is
Check this out as a way of doing what you want. It reads the file character by character and keeps reading until there are no more characters left instead of looking for the end of the file. Also it reads spaces and adds them to the string instead of ignoring them.
Sir, I am afraid I don't understand what std::noskipws is, I am fairly new to Programming with no background experience at all. Hope you can keep it beginner friendly
Sorry for jumping off, what I meant was that every time you input a value, it takes that value and swaps what is in the cstring with it. This coupled with the fact that you are reading in the file a word at a time causes it to just drop most of the file until the last word.
With your input file, this is what it would look like:
Well the problem with std::skiparys is that it only reads the first letter of my statements, ends the line starts the new line, prints first letter only and so on... I want to print it the way it is 2 lines and same number of spaces
0 H
1 e
2 l
3 l
4 o
5
6 W
7 o
8 r
9 l
10 d
11
12 f
13 r
14 o
15 m
16
17 m
18 e
19
20 I
21
22 l
23 i
24 k
25 e
26
27 t
28 o
29
30 p
31 r
32 o
33 g
34 r
35 a
36 m
37
38
Hello World from me
I like to program
Program ended with exit code: 0