•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 455,962 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,602 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 846 | Replies: 1
![]() |
•
•
Join Date: Nov 2007
Posts: 15
Reputation:
Rep Power: 2
Solved Threads: 0
Hello, I am trying to "peek" the next character to see if it is a character. If the word exceeds the max linelength it should be written in the next line with the count starting from zero again.
for example:
if the max line length is 10,
The max
length is
10.
rather than
The max le
ngth is 10
is this the correct if function?
thank you!
for example:
if the max line length is 10,
The max
length is
10.
rather than
The max le
ngth is 10
is this the correct if function?
cplusplus Syntax (Toggle Plain Text)
if (current >= linelength) { char a; if(isalpha(infile.peek())) { outfile.put('\n'); count = 0; } else outfile.put(current); count++; }
Last edited by cscgal : Nov 20th, 2007 at 6:17 am. Reason: Added code tags.
•
•
Join Date: May 2006
Location: ★ ijug.net ★
Posts: 1,012
Reputation:
Rep Power: 6
Solved Threads: 68
Use
if(count >= linelength)
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- fstream question (New to Daniweb) (Techies' Lounge)
- c++ functions for grades (C++)
- Stack using a linear linked list of arrays (C)
- passing a vector to a function? :errors: (C++)
- Disease Spread (C++)
- Question about comparing a string with a character (C++)
- General Protection Exception Error Please Help! (C++)
Other Threads in the C++ Forum
- Previous Thread: taking user input and searching a .txt file for matching records need a hint please
- Next Thread: Please help me in my Calculation



Linear Mode