Sponsored Content
Full Discussion: vector c++
Top Forums Programming vector c++ Post 302580859 by nishrestha on Saturday 10th of December 2011 11:05:22 AM
Old 12-10-2011
vector c++

hello guys.
i'm new to c++. i've problem using two dimensional vector.

i've a project of making conway's game of life. this is the code that i have made so far.
my problem is how can i give a two dimensional vector through main.
glider.vec1 = vec; is not correct way to give a two dimensional vector i think coz i dont get the desire result.

it'd be gr8 if u could help me. thx in advance.

Last edited by nishrestha; 12-12-2011 at 01:43 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

Saving a vector to a file

Another C++ question, please do notify me if this forum is C-only! :) I'm having a vector... vector<Person> x; ... with a class I've defined (Person). I have several elements in this vector and I would like to save it to a file (binary (?)). And later on open up this file to retrieve... (1 Reply)
Discussion started by: J.P
1 Replies

2. Programming

Linker error when using vector's

using SUN C++ I have a problem when I do a push_back on a vector. The linker gives me a undefined symbol error on __cxa_end_catch. Any ideas, is there a library to include? Thanks Chris (1 Reply)
Discussion started by: CDurkin
1 Replies

3. Programming

Vector Traversing

Hi i have the following structure struct S { char Mod_num; char val; char chr_nm_cd; } I am reading a 2GB file and inserting into the structure and writing into a vector. I feel like only vector will be a right option. I tried with multimap but it is memory intensive and hence i... (1 Reply)
Discussion started by: dhanamurthy
1 Replies

4. Programming

multidimensional array using c++ vector

Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (0 Replies)
Discussion started by: carl.alv
0 Replies

5. Programming

c++ mutidimentional arrays using vector

Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (1 Reply)
Discussion started by: carl.alv
1 Replies

6. Programming

C++ Map using a Vector as a Value Type?

I modified some code I found on Wikipedia concerning maps to see if it would work before applying it to a project I'm working on that has a similar idea. What I would want is for a user to be able to enter sentences and then be able to distinguish how many times a the person entered a word in a... (4 Replies)
Discussion started by: kcgb20
4 Replies

7. Programming

sort a vector

Hi all, I have a vector,the type of the element within it is list<int>,and i wanna sort this vector.So i implemented a function as a predicate for sort(the STL algorithm).Problem came when i missed the bold part in my code,g++ generated lots of error messages.And after i added the bold... (4 Replies)
Discussion started by: homeboy
4 Replies

8. Programming

Array and Vector

Hi all, from my understanding I understand that I can use array in this manner. struct test { int a; int b; int c; }; test testing; //creating an array with the structer type testing.a=1; testing.b=2; testing.c=3; If I'm not wrong we can use array in this manner,... (12 Replies)
Discussion started by: vinzping
12 Replies

9. Shell Programming and Scripting

Vector normalisation

In AWK For 3 individual vectors of the form: -2.772 -9.341 -2.857 -5.140 -6.597 -1.823 -2.730 -5.615 1.159 I would like to write a script that parses line by line to (i) normalise, (ii) divide by the norm for *each* vector. I.e. sqrt(-2.772^2 + -9.341^2 + -2.857^2)=10.154 ... (4 Replies)
Discussion started by: chrisjorg
4 Replies

10. Programming

Number to bit vector

Is there a function to convert number (unsigned int for this example) to binary? I could not find a simple one thru google. While I was learning bloom filter with the example, I was wondering if anybody can help me to 1) display the real bits vector for the bloomfilter; 2) if dataset is very... (11 Replies)
Discussion started by: yifangt
11 Replies
PLVECT(3plplot) 						    PLplot API							   PLVECT(3plplot)

NAME
plvect - Vector plot SYNOPSIS
plvect(u, v, nx, ny, scale, pltr, pltr_data) DESCRIPTION
Draws a vector plot of the vector (u[nx][ny],v[nx][ny]). The scaling factor for the vectors is given by scale. A transformation routine pointed to by pltr with a pointer pltr_data for additional data required by the transformation routine is used to map indices within the array to the world coordinates. The style of the vector arrow may be set using plsvect(3plplot). Redacted form: plvect(u, v, scale, pltr, pltr_data) This function is used in example 22. ARGUMENTS
u, v (PLFLT **, input) Pointers to a pair of vectored two-dimensional arrays containing the x and y components of the vector data to be plotted. nx, ny (PLINT, input) Physical dimensions of the arrays u and v. scale (PLFLT, input) Parameter to control the scaling factor of the vectors for plotting. If scale = 0 then the scaling factor is automatically calcu- lated for the data. If scale < 0 then the scaling factor is automatically calculated for the data and then multiplied by -scale. If scale > 0 then the scaling factor is set to scale. pltr (void (*) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer) , input) Pointer to function that defines transformation between indices in array z and the world coordinates (C only). Transformation func- tions are provided in the PLplot library: pltr0(3plplot) for identity mapping, and pltr1(3plplot) and pltr2(3plplot) for arbitrary mappings respectively defined by one- and two-dimensional arrays. In addition, user-supplied routines for the transformation can be used as well. Examples of all of these approaches are given in the PLplot documentation. The transformation function should have the form given by any of pltr0(3plplot), pltr1(3plplot), or pltr2(3plplot). pltr_data (PLPointer, input) Extra parameter to help pass information to pltr0(3plplot), pltr1(3plplot), pltr2(3plplot), or whatever routine that is externally supplied. AUTHORS
Geoffrey Furnish and Maurice LeBrun wrote and maintain PLplot. This man page was automatically generated from the DocBook source of the PLplot documentation, maintained by Alan W. Irwin and Rafael Laboissiere. SEE ALSO
PLplot documentation at http://plplot.sourceforge.net/resources. August, 2012 PLVECT(3plplot)
All times are GMT -4. The time now is 10:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy