Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
vector
- Page 1
Re: Hi everyone, I'm David with SayItOnTheWeb
Community Center
Say Hello!
2 Days Ago
by Dani
… computers. I would highly suggest that, instead, you use a
vector
animation in a loop that can provide the same desired…
Vector Output Problem
Programming
Software Development
16 Years Ago
by OmniX
vector
<string> div; div.pushback("a"); div.…
Re: Vector Out of Range
Programming
Software Development
13 Years Ago
by Ancient Dragon
>>
vector
<int> vectorOne(29); The array on line 10 and the
vector
only have 29 items, not 30. If you want 30 then say so. Count them on your fingers if you need to verify, 0, 1, 2, 3, ... 29, 30.
Re: vector of vectors
Programming
Software Development
15 Years Ago
by mrnutty
vector
<
vector
<char>> vset; //that should be an error because of the confusion of the stream operator >>. Need space between them.
Re: vector help
Programming
Software Development
15 Years Ago
by jeezcak3++
…; { typedef typename std::
vector
<T>::size_type size_type;
Vector
() { } explicit
Vector
(size_type n) :std::
vector
<T>(n) {}
Vector
(size_type n, const T…[](i); } }; // disgusting macro hack to get a range checked
vector
: #define
vector
Vector
// trivially range-checked string (no iterator checking): struct String : std…
Re: Vector help please
Programming
Software Development
15 Years Ago
by Nick Evan
… gama;928605] First question: What is [icode]void ShowInv(
vector
<string> inv)[/icode] mean? i know void… a [URL="http://www.cplusplus.com/reference/stl/
vector
/
vector
/"]
vector
[/URL]of strings. So when I say [icode]…function called [URL="http://www.cplusplus.com/reference/stl/
vector
/size/"]size()[/URL] which I use. What this…
Vector
Programming
Software Development
10 Years Ago
by aluhnev
…array const static int size = 10; cout << "
vector
from C-array: " << endl; int ia[…= { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
vector
<int> vi2(ia, ia + size); cout <<…lt; endl; // from argc/argv list cout << "
vector
of strings, from argc/argv list: " << endl…
Re: Vector help please
Programming
Software Development
15 Years Ago
by VernonDozier
…[ICODE][][/ICODE] to access a particular element of the
vector
. Also note the examples. What goes inside the the… brackets is the type that is stored in the
vector
. [code]
vector
[COLOR="Red"]<string>[/COLOR]…], as shown here in the declaration: [code] void ShowInv(
vector
<string> inv) [/code] inventory is of type …
vector
Programming
Software Development
14 Years Ago
by awesome3000
…quot;; cin>> Password; } void selectManagement(
vector
<string> &residents); string getLoginName…MANAGERS_TASK getManagersTask() {return managerstask;} }; void HOMEPAGE::selectManagrTask(
vector
<string> &residents) { string …
Vector Help
Programming
Software Development
16 Years Ago
by shadwickman
… with the following code. It creates a [i]
vector
<int>[/i] and assigns it the …ideas what's wrong? [code=cpp] #include <
vector
> #include <iostream> using namespace std; // …; i ++ ) deck[ i ] = i; // Shuffle shuffleDeck(); // Show deck
vector
<int>::iterator vit; for( vit = deck.begin(); vit…
Re: Vector help please
Programming
Software Development
15 Years Ago
by Nick Evan
…at(i) << endl; } int main() {
vector
<string> inventory; inventory.push_back("Battle Axe"…[code=cplusplus] #include<iostream> #include<
vector
> #include<string> using namespace std; … was not found!\n"; } int main() {
vector
<string> inventory; inventory.push_back("Battle Axe&…
Re: Vector help please
Programming
Software Development
15 Years Ago
by Nick Evan
…. It takes 2 parameters: the first in the current
vector
of inventory, the second is the item that you want…this functions takes 2 parameters. The first is a [icode]
vector
<string> [/icode] with your inventory in it. …call. [QUOTE=gangsta gama;928698] also dont know what [icode]
vector
<string>::iterator it[/icode] means. [/quote] I …
Re: vector
Programming
Software Development
14 Years Ago
by awesome3000
… i got the following errrors: 55 `void HOMEPAGE::selectManagrTask(std::
vector
<std::string, std::allocator<std::string> >… class `HOMEPAGE' 55 In member function `void HOMEPAGE::selectManagrTask(std::
vector
<std::string, std::allocator<std::string> >…
Re: Vector Help
Programming
Software Development
16 Years Ago
by shadwickman
… erased). At the end, the deck
vector
is assigned the value of the shuffled
vector
. This has been working for me so…
Re: Vector help please
Programming
Software Development
15 Years Ago
by VernonDozier
… numbers but can someone give me an example of
vector
.erase with letters? like for an RPG: like …] Numbers, letters, it doesn't matter what the
vector
contains. An element is an element, no matter what….com/reference/stl/
vector
/erase/[/url] [code] // erasing from
vector
#include <iostream> #include <
vector
> using namespace…
Re: Vector Help
Programming
Software Development
16 Years Ago
by Ancient Dragon
… to delete line 20 because erasing the contents of the
vector
willl also cause the program to crash.
Re: Vector Help
Programming
Software Development
16 Years Ago
by shadwickman
Oh! Wow that was a stupid mistake. I didn't realize I had been trying to use [icode]deck[ i ] = i;[/icode] on the
vector
without a length specified. Another option would be to replace line 32 with [icode]deck.push_back( i );[/icode], right? (I'm new to how vectors work in C++, obviously :P)
Re: Vector Help
Programming
Software Development
16 Years Ago
by Lerner
Works for me too. I keep getting the same shuffle of the deck because I didn't seed the random number generator before calling rand(), but I have had no problems with erasure of element from
vector
using either VC6++ or VC8Express.
Re: Vector help please
Programming
Software Development
15 Years Ago
by VernonDozier
…like this: [code=c++]// Sample
vector
erase #include<iostream> #include<
vector
> #include<string>… using namespace std; int main() { unsigned int i;
vector
<string> myvector; int numItems = 0; const int… One problem is when i try to add the
vector
at the end, the program crashes. Please help me…
Re: Vector help please
Programming
Software Development
15 Years Ago
by gangsta gama
… what you wanted to be deleted? i heard there was
vector
.erase. i dont know how to use it though :). Okay… me lost. i think you are using pointers to point
vector
<string> to inv. and i have no clue… what the ,string item means. also dont know what [icode]
vector
<string>::iterator it[/icode] means. i was thinking…
vector help!
Programming
Software Development
15 Years Ago
by newcmp
Hey, i've just joined...having trouble with a
vector
question.. the question asks that if a you …include <cstdlib> #include <cmath> #include <
vector
> using namespace std; void main() { // Variable declarations int i…" << endl; cin >> numSuitors;
vector
<int> suitors(numSuitors); for (i=0; i<…
Re: Vector help please
Programming
Software Development
15 Years Ago
by gangsta gama
…like this: [code=c++]// Sample
vector
erase #include<iostream> #include<
vector
> #include<string>… using namespace std; int main() { unsigned int i;
vector
<string> myvector; int numItems = 0; const int… One problem is when i try to add the
vector
at the end, the program crashes. Please help me…
Re: Vector help please
Programming
Software Development
15 Years Ago
by gangsta gama
… small code: First question: What is [icode]void ShowInv(
vector
<string> inv)[/icode] mean? i know void …declares and names the function but what does the [icode](
vector
<string> inv)[/icode] mean? does it name… another variable? if so what does [icode]
vector
<string>[/icode] really mean? Second question: what does…
Re: Vector help please
Programming
Software Development
15 Years Ago
by VernonDozier
…to cplusplus.com and see what functions are in the
vector
library. Write little sample programs using each of them,… will answer a lot of these questions. Note that
vector
has push_back and pop_back. With deque, you can pop… and when. niek_e wrote "pop" himself since
vector
doesn't have one. Experiment, google, then experiment some …
Re: <vector>
Programming
Software Development
9 Years Ago
by mridul.ahuja
…, whereas arrays are fixed**. You should always prefer using std::
vector
<T> since the destruction will be automatic once… the
vector
goes out scope and the allocated memory will be placed… and all the memory will be handled for you. std::
vector
<T> gives you everything you get in an…
Re: Vector help please
Programming
Software Development
15 Years Ago
by VernonDozier
Same program using strings: [code] // erasing from
vector
#include <iostream> #include <
vector
> #include <string> using namespace std…; int main () { unsigned int i;
vector
<string> myvector; for (i=1; i< 10…
Re: vector help!
Programming
Software Development
15 Years Ago
by Ancient Dragon
do you have to use a
vector
? It would be simpler to just use a std::string.
vector?
Programming
Software Development
12 Years Ago
by HacruLeian
… attributes that the user had enter. i thought of using
vector
to store all the attributes. but i don't think…
vector
can do/store the attribute and list it out with …
Re: vector?
Programming
Software Development
12 Years Ago
by Lucaci Andrew
…, let's call it `ToBeStored`, you should use the
vector
as this:
vector
<ToBeStored> list; ToBeStored obj; list.push_back(obj…
vector
Programming
Software Development
12 Years Ago
by complete
I have got the following in a header file for a class: #include <
vector
> #include <math.h> In the class description, I have the following protected member:
vector
<Point2D> samples; Point2D is defined as a class during compile time I get lots of errors (C2143, C4430 and C2238) Any ideas?
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC