|
-
June 5th, 2012, 03:44 PM
#1
Error, can't run
I got this code sent to me, and am working with a friend to see what the problem is. We can't seem to run it at all the even try to find the problems with its errors.
It just says the system cannot find the file specified. I was told to change something towards the beginning of the code to make it run at least, but still can't figure it out.
This is the code
Code:
/*
Mississippi has 11 characters
First occurance of word "is" is at position: 1
The first four characters are: Miss
The next two characters are: is
Charters start at position 9 are: pi
*/
#include <iostream>
#include <conio.h>
using namespace std;
int main ( )
{
string stateName = "Mississippi" ;
cout << stateName << " has " << length( ) << " characters\n";
cout << "First occurance of word \"is\" is at position: " << find("is") << endl;
cout << "The first four characters are:\t\t" << substr( 0, 4 ) << endl;
cout << "The next two characters are:\t\t" << substr( 4, 2 ) << endl;
cout << "Charters start at position 9 are:\t" << substr( 9, 5 ) << endl;
_getch();
return 0 ;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|