177 Topics

Member Avatar for
Member Avatar for ktsangop

Hello everyone! I would like your help regarding this: I have a tuple vector which i must iterate through, and accessing the vector data to decide wether to erase or not the current vector element. My code : typedef tuple <int, CString, int, int> pc_data; vector <pc_data> pc_vec; //Assume that …

Member Avatar for ktsangop
0
6K
Member Avatar for islam.fci.3

I want to write a class that do operation on two matrices by 2D vector but i have some problems with the 2D vector , any one can help me?

Member Avatar for tinstaafl
0
266
Member Avatar for Sonia11

I am in a small doubt of how to proceed to the next stage. 1. I have used im2col which basically turned gray-scale image into vector. 2. I have used the function vector quantization lbg algorithm which gave the VQ codebook as the output. I understand that the image I …

0
136
Member Avatar for Griff0527

Hello everyone. I am working on creating a stub that would allow me to swap out various sorting algorithms so that I can "plug in" the algorithms and run the various sorts. The below code is for Insertion Sort (yes, I know it is the slowest possible sort), but once …

Member Avatar for Griff0527
0
531
Member Avatar for JamesDanny

Hey Guys, i was looking at the post linked below and been trying to solve the issue, however, i have been unable to solve it. [Click Here](http://www.daniweb.com/software-development/java/threads/384109/data-from-text-file-into-jtable) The post says i "MUST create a new Vector for each row" in order for it to work. as mentioned above, i have …

Member Avatar for <M/>
0
280
Member Avatar for ray.tan.507

I was doing some exercise from C++ Primer and one of them required us to copy a set of value from array into a vector container. Then, we are suppose to remove all the even numbers from the vector container. Hoever, when I tried to display them out by incrementing …

Member Avatar for Nick Evan
0
201
Member Avatar for FearlessHornet

I'm currently making a DLL with a collection of code snippets that I find myself commonly using. I have made a search functin that checks if one string is inside of another string. I have also added a vector choice in the case that I want to search many strings. …

Member Avatar for mrnutty
0
222
Member Avatar for xHellghostx

Hello Is there anyway to move a string array elements to a vector and have an output that list these elements? Let's say the array contains the following elements `String arraySize[] = {"A", "B", "C", "D", "E"};` and I want to move these elements to a vector.. How would I …

Member Avatar for mvmalderen
0
598
Member Avatar for dreday92

Can someone tell me why I get this error "terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check Abort trap" when i run the following code? user and reservations are vectors of two classes else if (str == "lookup") { getline(cin, Name, '\n'); if (Name == user.at(i).getName()) { for …

Member Avatar for deceptikon
0
723
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 vlkaiser

Hi, Let me preface this by saying I'm about 4 days into learning MSVC++ 2010. I just need a little program that takes in a string, puts it in an array and I'd really like it to display it on the screen as the data comes in (1089 strings per …

Member Avatar for Ancient Dragon
0
406
Member Avatar for nullifyQQ

Please bear with me. This is my first post. For some reason, I can only display the strings if I put the cout in the same loop. But since I have to separate addString() and displayAllStrings(), I can't do that. My displayAllStrings() keeps failing. BUT when I write a separate …

Member Avatar for Lucaci Andrew
0
1K
Member Avatar for mystra

Hi guys, I need some help with a particular part of a C++ DirectX game. My course has tasked me with creating a game similar in look and function to the old missile command arcade game (something like [this](http://www.youtube.com/watch?v=t-cD0XdyQ7s)), however I have hit a bit of a wall in terms …

Member Avatar for Chase.Dangerfield
0
254
Member Avatar for Alexkid

Hi there I need help writing a data structure to hold and assign data to a particular unique ID. I think I want an vector of structures: struct Data { int ID; double latitude; double longitude; int speed; int altitude; }; I receive messages in the above format, they can …

Member Avatar for Gonbe
0
264
Member Avatar for darkeclipse8

My professor asks me to program the Game Of Life with some required and I find unnecessary classes. But anyhow as I am coding and running the program midway I run into this problem void Life::setup_grid() { cout << "Size of Grid: " << grid.size() << endl; cout << "rows: …

Member Avatar for NathanOliver
0
386
Member Avatar for narlapavan

#include<iostream> #include<vector> #include<algorithm> using namespace std; class Cords { public: int x,y,z; }; class Object:public Cords { int a,b,c; public: vector<Cords> vCords; void insertCords(); void getCords(); }; void Object::insertCords() { Cords theCords; int x=1; do { cout<<"Enter X:"<<endl; cin>>x; cout<<"Enter a b c:"<<endl; cin>>a>>b>>c; theCords.x=a; theCords.y=b; theCords.z=c; vCords.push_back(theCords); }while(x!=0); } …

Member Avatar for deceptikon
0
219
Member Avatar for kevin.peris.90

i want to represent some locations using a vector map. which website allows this kind of private map creation and sharing. tried arcgis they make it compuslory to make the map public to share. thanks

Member Avatar for yewbhex
0
97
Member Avatar for orar

#include <iostream> #include<string> #include<vector> using namespace std; struct Names { string fname; string lname; void output() { cout<<fname<<" "<<lname; } void input() { cin>>fname>>lname; } }; struct birth_info { int month; int day; int year; void input() { cin>>month>>day>>year; } void output() { cout<<month<<"/"<<day<<"/"<<year; } }; int main() { string …

Member Avatar for deceptikon
0
179
Member Avatar for paul9519

hi everyone i have a problem with this code below. when i try to read all the files in a directory i can but when i try to put them in a vector, it doesn't work, all the elements in the vector become the last element added. I'm not sure …

Member Avatar for Tumlee
0
210
Member Avatar for Ja14

There is a lot more that is supposed to go with this. For now, I'm just trying to implement a class that uses a vector. Class is called ItemList, it's the header file. Main creates the object and attempts to add to the vector. Compiler doesn't recognize "list" as a …

Member Avatar for deceptikon
0
4K
Member Avatar for Geowil

I decided that before I would actually write the code for my planned inventory system in a game I am writing I would test it out in a small project first to make sure I know what needs to be done and if I needed to change anything. So I …

0
97
Member Avatar for Fedhell

Hey guys, its been quite a while since ive posted here :-( Im making a game in java (nope not for school, just for fun) Anyway, ive created some logic for an enemySuicideBomber(spaceship game, prolly not what your thinking) to select the closest location. It works for the most part, …

Member Avatar for NormR1
0
218
Member Avatar for rahul.ch

import java.util.*; class SampleA { } class SampleB extends SampleA{ } class SampleC extends SampleA{ } class VectorDemo { public static void main(String r[]) { Vector<SampleA> v = new Vector<SampleA>(); v.add(new SampleB()); v.add(new SampleC()); SampleC rect = v.get(2); } } The output says "Incompatible types. Found SampleA, required SampleC. SampleC …

Member Avatar for rahul.ch
0
225
Member Avatar for Geowil

At the moment I have one question about vectors but I want to leave this open ended so if I obtain more questions I can come back here. So I was looking at different containers for a player inventory that can be dynamically changed on the fly due to events …

Member Avatar for Geowil
0
251
Member Avatar for 47pirates

I want to store a Vector<Vector<Object>> in mysql database. What is the best data Tpye that i can use in mysql and java to store and retrieve the datas.

Member Avatar for stultuske
0
376
Member Avatar for userIT

Given the trace program below. I basically need to store a 1 or a 0 to the corresponding `a[r[i]]` the problem is I need to be able to keep track of the index of vectors zero and one to check the last index that was used for each vector. For …

Member Avatar for userIT
0
179
Member Avatar for resmi sanker

can u give me some details regarding this paper?can u plz tell me what is a master defect record and feature association?

Member Avatar for rubberman
0
148
Member Avatar for Ararat

I'm trying to compare the element pointed by an iterator to an integer, but so far i haven't had any luck in doing so. please correct whatever i'm doing wrong. Thank you. vector<int>::iterator y; for (int i = 0;i<n2;i++) { cin>>temp; cnt = 0; y = lower_bound(a.begin(),a.end(),temp); if (*y == …

Member Avatar for Ararat
0
1K
Member Avatar for Hazardous_Byte

Hello everyone! I am having a bit of an odd problem here. So, on my Visual Studio project, I decided to use a precompiled header. This didn't seem to cause a noticable problem up until today. I have a small segment of code that is supposed to remove one element …

Member Avatar for Hazardous_Byte
0
671
Member Avatar for sandz24

#include <iostream> #include <vector> using namespace std; template< typename T > using matrix = vector< vector<T> > ; I saw this code snippet while searching for templates. I was wondering why there's a word "using". What is it for? Thanks :)

Member Avatar for sepp2k
0
164

The End.