![]() |
|
#1
|
|||
|
|||
help with c++ vectorsI need some help using vector.h and initializing/declaring a vector and how to pass it through functions.
I don't know the correct syntax for declaring a vector in a function maybe this: void solve(int num, vector<double> &vecA) { } any help would be appreciated thanks |
|||
|
#2
|
|||
|
|||
vectorsHey,
The code you wrote is fine for passing vectors to a function. Very well done. In terms of defining a vector, the following are the standard examples used in the STL. To declare a vector: CPP / C++ / C Code:
To define a vector using an array: CPP / C++ / C Code:
Hope this was helpful, Pan Thomakos |
Recent GIDBlog
Problems with the Navy (Enlisted) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C++ Vectors | Katie | C++ Forum | 5 | 17-May-2004 23:36 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The