Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~2K People Reached
Favorite Forums
Favorite Tags
c++ x 27
Member Avatar for Tom_Weston

Hi, I'm wondering how to remove a specific part of a string.. [CODE] #include <iostream> #include <string> using namespace std; int main() { string str1 = "How,Are"; cout << str1; //remove the comma, and everything behind the comma! so the output would only be 'Are'. return 0; } [/code] Thank …

Member Avatar for Xaviorin
0
353
Member Avatar for Tom_Weston

Basically, what i would like is if the two letters are attached together (NOT seperated) in the string, it will say good, if not the bad. Example: [CODE] #include <iostream> #include <string> int main () { string letters = "or"; string test = "The man went to the store."; //here …

Member Avatar for WaltP
0
154
Member Avatar for Tom_Weston

What i basically want is more than one character to be found. If h and a are in the string then it will print it. But it will only work if there is a single char. [CODE] #include <iostream> #include <stdio.h> #include <string.h> int main () { char str[] = …

Member Avatar for MonsieurPointer
0
110
Member Avatar for Tom_Weston

So example.txt contains this; [B]The Man Walked Into The Forest[/B] What I would like is for it to show, what line the word "Walked" is on. [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; string word = "Walked"; ifstream myfile ("example.txt"); if …

Member Avatar for Tom_Weston
0
83
Member Avatar for Tom_Weston

I have no idea how this would be done, but how would I check the amount of line that exist in a text file. [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("example.txt"); if (myfile.is_open()) { while ( myfile.good() ) …

Member Avatar for L7Sqr
0
98
Member Avatar for Tom_Weston

I was just wondering, how to check how many 't's there are in the sentence? [CODE] #include <iostream> #include <string> using namespace std; int main() { string test = "The man played with the ball in his backyard."; return 0; } [/CODE]

Member Avatar for mrnutty
0
102
Member Avatar for Tom_Weston

So, as you can see... [code] #include <iostream> #include <string> using namespace std; int main() { char comma = ','; string str1 = "hello,friend"; string str2 = str1.substr(str1.find(comma)+1, str1.length()); //i guess this line... cout << str2 << endl; system("pause"); return 0; } [/code] What is being output is str2, and …

Member Avatar for gerard4143
0
127
Member Avatar for Tom_Weston

Alright, so what I would like to see happen is two strings attached. I know I can cout << them both and they will output an attached string, but what if i want to call the attached string in another area of my code? [CODE] #include <iostream> #include <string> using …

Member Avatar for Tom_Weston
0
134
Member Avatar for Tom_Weston

I want it so that i can enter multiple things upon input. Here's my code: [CODE] #include <iostream> #include <string> using namespace std; int main() { char dot; dot = '.'; string sztext1; string sztext2; cin >> sztext1 >> dot >> sztext2; cout << "Works..." << endl; system("pause >nul"); return …

Member Avatar for Tom_Weston
0
108
Member Avatar for Tom_Weston

[CODE]#include <iostream> #include <windows.h> #include <string> using namespace std; void main() { string run; cin >> run; ShellExecute(NULL, NULL, run /*<<<the error*/, NULL, NULL, SW_SHOWNORMAL); }[/CODE] I want it so if i enter a file path, it open. If i replace run with "E:/test.exe", it works... but i want it …

Member Avatar for Tom_Weston
0
172
Member Avatar for Tom_Weston

How to hide my Win32 console application to the system tray (placed as an icon).

Member Avatar for Taywin
0
91
Member Avatar for Tom_Weston

What I would like is when I input the file path in the console window (lets say C:\hello.txt), I would like it to create, open, then write text into the file. Here's an example of my code. [CODE]#include <iostream> #include <fstream> #include <string> using namespace std; int main () { …

Member Avatar for Tom_Weston
0
102
Member Avatar for Tom_Weston

What I want is when I type "calc;" (without quotes), The calculator opens. Else, if I didn't type it correctly (example: "calc" (without quotes)) it will generate an error. [CODE]#include <iostream> #include <string> using namespace std; int main () { string calc; char end; end = ';'; cin >> calc …

Member Avatar for Tom_Weston
0
83