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.

0 Endorsements
~8K People Reached
Favorite Forums
Favorite Tags
c++ x 44
Member Avatar for tech9x

i want my data can be used over every function, so i need a class to capture them, am i correct?? here is my outline, im not sure if i use it correctly, please help!! [code=c++] class CLASS { private: int * (something) string * (something) public: void (function) () …

Member Avatar for Greywolf333
0
246
Member Avatar for tech9x

[CODE=C++] 1. //my main 2. int sizeOfArray; 3. 4. int main() 5. { 6. int i; 7. int *num1, *num2, *num3, *num4, *num5; 8. string *opening, *ending; 9. cin >> sizeOfArray; 10. command = new string [sizeOfArray]; 11. opening= new int [sizeOfArray]; 12. num1= new int [sizeOfArray]; 13. num2= new …

Member Avatar for jonsca
0
100
Member Avatar for tech9x

here is my outline of code: [code=c++] void apple() { cin >> price[i]; cout << price[i]; //give out correct value } void orange() { cin >> price2; cout << price[i]; //mess value (like 65534 or 9460301) } int main() { string *fruit; int *price; fruit = new string[n] price = …

Member Avatar for tech9x
0
144
Member Avatar for tech9x

[code=c++] #include <iostream> #include <fstream> #include <cstring> #include <string> #include <stdio.h> #include <stdlib.h> #include <limits> using namespace std; void call(int i, int * test) { cin >> test[i]; } int main() { int sizeOfArray; int *temp; int i; cin >> sizeOfArray; int * test; string * command; command = new …

Member Avatar for mike_2000_17
0
126
Member Avatar for tech9x

for example my array is test[10], and i want to clear 2 of the 10 memory, how to do that??

Member Avatar for tech9x
0
225
Member Avatar for tech9x

[code=c++] int main() { Appointment appt; int i; string *description; int *day, *month, *hour, *min, *_hour, *_min; char chr, chr1, chr2, chr3; string *command; command = new string [sizeOfArray]; int sizeOfArray; cin >> sizeOfArray; for(i= 0; i< sizeOfArray; i++){ cin >> command[i]; if (command[i] == "cancel"){ // <---- ERROR OCCURS …

Member Avatar for mike_2000_17
0
129
Member Avatar for tech9x

[code=c++] int i; string *opening; string *ending; int *num1, *num2, *num3, *num4, *num5, *num6; char chr, chr1, chr2, chr3; for(i= 0; i< sizeOfArray; i++) { getline(cin,opening[i]); cin >> num1[i] >> chr >> num2[i] >> num3[i] >> chr1 >> num4[i] >> chr2 >> num5[i] >> chr3 >> num6[i]; getline(cin,ending[i]); } [/code] …

Member Avatar for jonsca
0
149
Member Avatar for tech9x

here is my code [code=c++] int main() { int i; char * cstr; char * p; string *userInput; int sizeOfArray; cin >> sizeOfArray; add(i,userInput,sizeOfArray); system("PAUSE"); } void add(int i, string *userInput, int sizeOfArray) { string Input; char * cstr; char * p; userInput = new string [sizeOfArray]; for(i= 0; i< …

Member Avatar for Zjarek
0
278
Member Avatar for tech9x

[code=c++]void getCommands(char * cstr,char * p,string *userInput,string Input) { string currentCommand = ""; strcpy (cstr, userInput.c_str()); p = strtok (cstr," "); while (p!=NULL) { p=strtok(NULL," "); cout << p; } [/code] ERROR `c_str' has not been declared request for member of non-aggregate type before '(' token I have #include <cstring> …

Member Avatar for jonsca
0
318
Member Avatar for tech9x

i want to find the number in a string and then store it into int, i tried sub string, but the compiler tells me that i cannot convert string to integer. what can i do??

Member Avatar for WaltP
0
73
Member Avatar for tech9x

[code=c++]while(!infile2.eof()) { size_t found; string temp2, store, wordtobold; string command1 ("bold"); size_t prev_pos = 0, pos = 0; getline(infile2, temp2); store += temp2; found=store.find(command1); if (found!=string::npos) wordtobold = store.substr (found+4); while( (pos = wordtobold.find(' ', pos)) != string::npos ) { string wordtotag( wordtobold.substr(prev_pos, pos-prev_pos) ); cout << wordtotag; prev_pos = …

Member Avatar for WaltP
0
115
Member Avatar for tech9x

[code=c++] while( getline( infile2, temp2 ) ) { size_t prev_pos = 0, pos = 0; while( (pos = temp2.find(' ', pos)) != std::string::npos ) { string wordtobold( temp2.substr(prev_pos, pos-prev_pos) ); cout << wordtobold << '\n'; prev_pos = ++pos; } string wordtobold(temp2.substr(prev_pos, pos-prev_pos) ); // Last word cout << wordtobold << …

Member Avatar for tech9x
0
2K
Member Avatar for tech9x

my program is to open a input file, i do not know what words is in the file, and i have to open a command file (a text file), the command file is to tell the program what word to search and what to do, also i do not know …

Member Avatar for WaltP
0
111
Member Avatar for tech9x

i got a .txt file that contain data, and i would like to read from the file and then write the data to another file, is it about ifstream and ofstream?.. what i have done is just open the input file and open the output file :(( how to relate …

Member Avatar for vijayan121
0
4K