| | |
I need help with my homework!
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2006
Posts: 4
Reputation:
Solved Threads: 0
Hi,
I need help with my homework please, its due tommorow and i prommise to show my efforts in the next days
http://www2.filehost.to/files/2006-1...4316_cplus.jpg
Thanks in advance
I need help with my homework please, its due tommorow and i prommise to show my efforts in the next days

http://www2.filehost.to/files/2006-1...4316_cplus.jpg
Thanks in advance
Show your effort now, then we can help you with the next step.
http://www.daniweb.com/techtalkforum...cement8-2.html
http://www.daniweb.com/techtalkforum...cement8-2.html
•
•
Join Date: Oct 2006
Posts: 4
Reputation:
Solved Threads: 0
I know that it means this:
below is a string of 20 chars
[01234567890123456789]
The first twelve are
[012345678901]
The last twelve are
[890123456789]
the middle 4 of the first string are shown marked with () below:
[0123(4567)08901]
the middle for of the last twelve are shown marked with () below:
[8901(2345)6789]
below is a string of 20 chars
[01234567890123456789]
The first twelve are
[012345678901]
The last twelve are
[890123456789]
the middle 4 of the first string are shown marked with () below:
[0123(4567)08901]
the middle for of the last twelve are shown marked with () below:
[8901(2345)6789]
Maybe this will kick-start you
There are all sorts of different methods for manipulating strings.
http://www.sgi.com/tech/stl/basic_string.html
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <string> using namespace std; int main ( ) { string s = "hello world"; cout << "The length is " << s.length() << endl; cout << "The 5th character is " << s[4] << endl; return 0; }
There are all sorts of different methods for manipulating strings.
http://www.sgi.com/tech/stl/basic_string.html
•
•
Join Date: Oct 2006
Posts: 1
Reputation:
Solved Threads: 0
to define a string variable,
then read in,
then using the string stl use the necessary functions.
in particular look at, s.length(), s.substr()
the rest is trivial once you know how to use these functions.
C++ Syntax (Toggle Plain Text)
string s;
C++ Syntax (Toggle Plain Text)
cin >> s;
in particular look at, s.length(), s.substr()
the rest is trivial once you know how to use these functions.
Last edited by jdarvwill; Oct 17th, 2006 at 12:06 pm.
![]() |
Similar Threads
- We only give homework help to those who show effort (Computer Science)
- Need help with Computer Science homework (Computer Science)
- Dynamic memory allocation homework (C++)
- Homework Help!! Priority Queue ?? (Computer Science)
Other Threads in the C++ Forum
- Previous Thread: Object and classes doubt
- Next Thread: Another C++ N00B Begging For Help
| Thread Tools | Search this Thread |
api array beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project proxy python read recursion recursive return sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






