31 Topics

Member Avatar for
Member Avatar for DS9596

I did some don't know how to read into the vector, need help on this assignment: Rich Software Inc. has hired you for an internship position to create new payroll software for their employees. Your goal is to create a program that reads the newdata.txt file with their salaries. After …

0
152
Member Avatar for Rootz

When I try to compile my code in visual basic 2010 it gives me the error 1903 and when I compile the code in Code::Blocks it opens the standard template library's algorithm.h file and takes me to line 2163 if (*__i < *__first) I don't want to modify anything here, …

Member Avatar for Rootz
0
820
Member Avatar for asundar

Hey everyone, So, I need help understanding why I'm not able sort my code: here is my code (so far) for my selection sort. I have only written the iterative form of Selection Sort, but I know how to do it recursively as well (which is required for my homework). …

Member Avatar for tinstaafl
0
832
Member Avatar for asteriskLMNOP

Please bear with me, this is my first post So, I have this superclass called A. And I've 2 subclasses A1 and A2. A has attribute name. A has function toString(). A1 inherits name, and has attribute hair. A1 has a method toString() which goes: string A1::toString(){ string stringA= A::toString(); …

Member Avatar for ravenous
0
1K
Member Avatar for nullifyQQ

I have this weird problem. If my constructor is [header] class Book { private: vector<string>Entry; public: Book(); [cpp] Book::Book(){ Entry.push_back("0"); Entry.push_back("1"); Entry.push_back("2"); The weird thing is that it does not update when I do more .push_back. I use: void Book::addItem(vector<string>newItem) { for(int f=0; f<Entry.size(); f++) { Entry.push_back(newItem[f]); cout<<Entry[f]; } } …

Member Avatar for L7Sqr
0
289
Member Avatar for MachDelta

Hi everyone. I've been struggling with a quicksort implementation here. I think - scratch that - I know i'm overrunning an array (erm, vector) based on how it explodes, but I honestly can't see it and I have no debugger. I slept on it but fresh eyes didn't get me …

Member Avatar for ken_taiken
0
226
Member Avatar for zenitis

I have a declaration of a 2d vector: vector<vector<int> > data; I want to add several times in an server-client problem an array of 25 elements. I donnot know how many times i must add that array(which changes its values). How can i add that element to the vector without …

Member Avatar for deceptikon
0
175
Member Avatar for PeTo.

I'm having some trouble making my snake move :D I can move one point in any direction but the whole body of the snake is where I'm confused , if(a == (char) 119 || a == (char) 87 || a == 72) { y=y--; gotoxy(x,y); PrintVector(v); } thats works just …

Member Avatar for PeTo.
0
2K
Member Avatar for sergent

I decided to learn C++ STL and I was exprimenting with STL containers. I saw this example [here](http://www.cplusplus.com/reference/stl/vector/insert/): // inserting into a vector #include <iostream> #include <vector> using namespace std; int main () { vector<int> myvector (3,100); vector<int>::iterator it; it = myvector.begin(); it = myvector.insert ( it , 200 ); …

Member Avatar for sergent
0
324
Member Avatar for zios007

Yes, I know that this is homework. But I need help. This is code the teacher gave us few days ago. This is a header file. And I needed to do the following: My problem is that I didn't know how to use my vecetor in my .cpp file. How …

Member Avatar for sergent
0
133
Member Avatar for surajrai

I have a method that returns void. say: Public void CreateRectangle(double z, double y, IRectangle rectObj) { Vector3d recPos1 = new Vector3d() recPos1.X = 0; recPos1.Y = some double vale; Vector3d recPos2 = new Vector3d() recPos2.X = some double value; recPos2.Y = 0; rectObj.SetVectors(recPos1, recPos2); } now, in my unit …

Member Avatar for thines01
0
514
Member Avatar for arubajam

Write a statement that declares and stores the elements of the following array into a vector object: char vowels[5]={'a', 'e', 'i', 'o', 'u'}; I think this is what I need, but I want to verify this. [CODE]char vowels[5]={'a', 'e', 'i', 'o', 'u'}; vector<vowels> vowelsList (vowelsArray, vowelsArray +5);[/CODE]

Member Avatar for subith86
0
175
Member Avatar for drico7041

Hey, I was having trouble making my vector print out randomly generated numbers in ascending order. Can I please get some help?. This is my assignment "Write a program name count.java that will use a Vector to store 10,000 randomly generated numbers (ranging from 1 to 99) Now sort the …

Member Avatar for drico7041
0
180
Member Avatar for hamby

Hi i'm making a function that will return make a series of strings and perform a function returning a value for each. I've stored the strings in one vector v, and the integer values in another v2. Then it is supposed to return the string that corresponds to the smallest …

Member Avatar for hamby
0
7K
Member Avatar for inamul20

Hi!! my application have 2 frames including tabel 1,tabel 2 when run time i insert values though textfileds to tabel 1 ,after inserting 5 or more then i click next button then display other frame with tabel 2 and tabel 2 must auto filled. my problm is last row(i already …

Member Avatar for JamesCherrill
0
225
Member Avatar for jmay1327

I am trying to display the sNames vector. I am not sure if I am storing the information correctly. Any help would be greatly appreciated. Also I am trying to get an average for each students exam grades and a class average, and I am not sure how to go …

Member Avatar for jmay1327
0
209
Member Avatar for debuggger

Hey - I'm looking for something similar to using vectors and pointers that I've used before in C++; unfortunately, it doesn't seem like there's an equivalent function in VB.net. What I have is a copy of the array behind a multi-line Rich Text Box, and I need to separate the …

Member Avatar for Reverend Jim
0
184
Member Avatar for Triarius

Hi! It's me again :) I have failed with my C++ code once again. This time it's with vectors. [CODE]string show_actions(){ vector<string> actions; actions.push_back("end"); actions.push_back("hunt"); vector<string>::const_iterator iter; cout <<"All of the possible actions are : " << endl; for(iter = actions.begin(); iter != actions.end(); ++iter){ cout << *iter << endl; …

Member Avatar for Triarius
0
186
Member Avatar for magnetic rifle

Is it possible to assign a variable to be a random vector. The only syntax I could find was rand.jumpahead but further research did not seem promising. Thank you, Suhail

Member Avatar for Gribouillis
0
156
Member Avatar for nocloud

I have a the following snippet of code [CODE]string const& symbol::at(int index) const { assert(index<symbol_data.vector::size()); return symbol_data.vector::at(index); }[/CODE] This does not compile successfully, instead, I get complaints about [CODE]error: ‘template<class _Tp, class _Alloc> class std::vector’ used without template parameters[/CODE] Now, I think this has something to do with the fact …

Member Avatar for mrnutty
0
323
Member Avatar for niranga

Hi All, Is it possible to bind an array or a Vector with a event listener? For an example if we add an element to the Vector or remove from the Vector, can I use an event listener to track the changes? Thanks a lot in advance. Cheers..!!

Member Avatar for niranga
0
980
Member Avatar for 02marks

Hi, I am trying to write a program for my mum who is a teacher, the program needs to be able to store students information like their name address SAT scores etc. I have a basic background in c, but i decided to try and implement this program using c++. …

Member Avatar for thelamb
0
195
Member Avatar for PaulBird

ok, so i want a program that just says back to the user their input. the users input will be more then one word, so there will be whitespace. when i use string as a class for the input, then it only gives back the FIRST word of the input.... …

Member Avatar for frogboy77
0
248
Member Avatar for fibbo

Alright, I suspect there is already a solution here somewhere on the forums but I'm not quite sure I'm searching for the right terms so I hope you dont mind me asking the question anyway. My goal is to make a constructor for a class called building. instance variables are: …

Member Avatar for mike_2000_17
0
2K
Member Avatar for KansaiRobot

Hello All. This is my first post. I would really appreciate if you can help me in a project I have to complete as soon as possible anyway, the thing is this: I have a bunch of numerical data in any format (say an excel page with 3D vectors, or …

Member Avatar for KansaiRobot
0
185
Member Avatar for jshoot

Hi everyone, My question is: I have two vectors, for example vectorA and vectorB, vectorA is filled with randomics values, like 23, 43, 54, etc, and its have 1000 members, like vectorA[0], vectorA[1], etc. My vectorB descending of vectorA, I use the "push_back" function to take the values of vectorA, …

Member Avatar for jshoot
0
257
Member Avatar for gavGaz

Hi all, I'm trying to create code which manipulates data within a vector. The vector contains floating points which store consecutive 3D values. For example element 1 stores object 1 x coords, element 2 - object 1 y coords, element 3 - object 1 z coords, element 4 object 2 …

Member Avatar for Fbody
0
166
Member Avatar for RapidFire4Life

Hi, i have to write a program to allow the user to input 5 candidate names and the number of votes they received, then it calculated what percent of the vote each candidate received and then ten tells the user who won. I think I've got a code that will …

Member Avatar for RapidFire4Life
0
263
Member Avatar for bensewards

Hey everyone, In my COMP 208 class, I was asked to do the following: "Redo Lab 2 Problem 2, only this time use vectors to hold the names and gpa’s instead of arrays. So you will work with 2 vectors, one holding the gpa’s (type double) and the other holding …

Member Avatar for user422
0
196
Member Avatar for Lord_Migit

Hey folks, just a quick question i can't seem to find the answer to. If i overwrite a container with a pointer in it, does the pointer and therefore the object it points to still exist, and would that be considered a bad handling of memory. For instance. I have …

Member Avatar for Lord_Migit
0
137

The End.