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
~993 People Reached
Favorite Forums
Favorite Tags
c++ x 15
Member Avatar for thisischris

Say I have something like this [CODE] #include <iostream> #define ICOL 32 using namespace std; int main(int argc, char *argv[]) { ... [/CODE] Is there a way that I can change the value of that global variable within main? Simply saying ICOL = 300; does not work...

Member Avatar for mike_2000_17
0
174
Member Avatar for thisischris

so the user enters a string of coordinates like "(1,2) (3,4) (5,6) etc..." and I'm trying to use istringstream to pull out each number and put it into an integer value. This is what I've got so far: [CODE] string S1, temp; int num1=0, tempX, tempY; cin.ignore(15,'\n'); getline(cin,S1); num1=S1.find("("); S1.erase(S1.begin(),S1.begin()+num1+1); …

Member Avatar for thisischris
0
202
Member Avatar for thisischris

So I'm trying to overload the extraction operator, but I keep getting an ambiguous overload error. Here's the extraction that I'm using: [CODE] bool cc = false; cout << CC; [/CODE] And here's the overload function. [CODE] ostream& operator<< (ostream &out, bool &C1){ if(C1) out << "A"; if(!C1) out << …

Member Avatar for caut_baia
0
194
Member Avatar for thisischris

So I'm working with these strings and I'm stumped at this one part. Here's the instructions: "After removing leading and trailing blank characters (<SPACE> or <TAB>), the string must not be empty." .empty() will obviously be used, but how do I check for the " " or "\t" characters and …

Member Avatar for mrnutty
0
103
Member Avatar for thisischris

[CODE]void DeleteMovie(vector<Movie> &M1){ cout << "Option selected: delete a movie from the database" << endl; string T1; int TT=0; if(M1.size()<1){ cout << ">Error: There are no movies to delete.<" << endl; } else{ cin.ignore(100,'\n'); cout << "Enter the title of the movie you want deleted: "; getline(cin,T1); for(int i=0;i<M1.size()+1;i++){ if(M1[i].Get_Title()==T1){ …

Member Avatar for thisischris
0
93
Member Avatar for thisischris

I'm having trouble with vectors. I have a class that I read from a file, then I insert it into a vector. It should work fine, but my compiler crashes every time. Am I not using the vector correctly? [CODE]#include <iostream> #include <string> #include <iomanip> #include <fstream> #include <sstream> #include …

Member Avatar for thisischris
0
97
Member Avatar for thisischris

So I have a data file that looks like this [CODE] Movie1 Year Salary Actor1, Actor2 Movie2 Year Salary Actor3, Actor4, Actor5 ... etc [/CODE] The part that's throwing me off is the actors line. It can have from 1 to 5 actors on it, separated by commas. I have …

Member Avatar for Duoas
0
130