| | |
Newbie string problem
![]() |
Hello. I have this problem:
I have a let's say [1000] char string and i want to split and print this on the screen on more lines, so that each and every line has MAXIM 43 characters. The string may contain spaces and the words would be printed on the next line if they cant fit on the current line...
I have no idea how to do that. I know how to show the letters from, lets say [100] to the end of the string, with StringName+100, but how can i show the string from 100 to 143?...
Thank you in advance.
I have a let's say [1000] char string and i want to split and print this on the screen on more lines, so that each and every line has MAXIM 43 characters. The string may contain spaces and the words would be printed on the next line if they cant fit on the current line...
I have no idea how to do that. I know how to show the letters from, lets say [100] to the end of the string, with StringName+100, but how can i show the string from 100 to 143?...
Thank you in advance.
Use counter which will print the chars.
The second question also can solve with counter.
c Syntax (Toggle Plain Text)
for(i=0; i<totalLengthOfString; i++) { if(i != 0 && i % MAXIM == 0) { putchar('\n'); } putchar(string[i]); }
If you want to win, you must not loose (Alan Ford)
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- System.String.LastIndexOf problem (C++)
- vb.net NEWBIE!! Triangle problem!! (VB.NET)
- string problem (IMPORTANT) :(( (C)
- ANSI string problem (C++)
Other Threads in the C Forum
- Previous Thread: Delete an item from an array
- Next Thread: program output
| Thread Tools | Search this Thread |
#include adobe api array arrays asterisks binarysearch calculate char cm copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax database directory dynamic feet fflush fgets file fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o include incrementoperators input interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix meter microsoft motherboard mqqueue mysql number odf open openwebfoundation owf pattern pdf performance pointer posix probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling segmentationfault send sequential shape socket socketprograming stack standard string systemcall turboc unix user voidmain() wab win32api windows.h






