Monday, July 1, 2013

New comer's question on STL/vector::data() over Dev-Cpp

Newsgroup: comp.lang.c++

Subject: New comer's question on STL/vector::data() over Dev-Cpp

From: joshipura@...

Date: Mon, 1 Jul 2013 04:01:48 -0700 (PDT)



Hello all,

I am new to C++.



Question #1: What the problem is:

============

I have Dev-Cpp 4.9.9.2 on Windows 7/64 bit.

I am trying out code from http://www.cplusplus.com/reference/vector/vector/data/ on it.

It fails with

main.cpp:42: error: 'class std::vector<int, std::allocator<int> >' has no member named 'data'



--->Is the website code wrong and there is no vector::data()?

--->Is the package of Dev-Cpp wrong?

--->Both?



Question #2: Why the problem is:

============

I need help in solving this for Sudoku solver program.

I store row, column and box as vectors and need to find an intersection of the trio.

As I understand from examples from http://www.cplusplus.com, in order to use std::set_intersection, I need to pass two arrays with lengths and a vector to store the difference.

This forces me to convert row, column and box into arrays using vector::data(), which fails.



--->Is there a way out without using vector::data()?



Thanks in advance!







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?32693-New-comer-s-question-on-STL-vector-data()-over-Dev-Cpp&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

No comments:

Post a Comment