value_type of vector

G

George2

Hello everyone,


I think the value_type of vector<int> should be int and the value_type
of vector<int> should be int*. But I am not 100% sure,

1. how to write a program to verify this idea;
2. where to find the definition that the value_type of interator of
vector<int> is int*.

It is appreciated if you could help.

Code:
#include <vector>

using namespace std;

int main (int argc, char** argv)
{
	vector<int>::value_type;  // should be int ?
	vector<int>::iterator::value_type; // should be int* ?

	return 0;
}


thanks in advance,
George
 
R

Richard Heathfield

George2 said:
I think the value_type of vector<int> should be int and the value_type
of vector<int> should be int*. But I am not 100% sure,

1. how to write a program to verify this idea;
2. where to find the definition that the value_type of interator of
vector<int> is int*.

Try asking in comp.lang.c++, where they might have a fighting chance of
answering your question correctly.
 
S

santosh

Hello everyone,


I think the value_type of vector<int> should be int and the value_type
of vector<int> should be int*. But I am not 100% sure,

1. how to write a program to verify this idea;
2. where to find the definition that the value_type of interator of
vector<int> is int*.

It is appreciated if you could help.

Code:
#include <vector>

using namespace std;

int main (int argc, char** argv)
{
vector<int>::value_type;  // should be int ?
vector<int>::iterator::value_type; // should be int* ?

return 0;
}

Isn't this the third time you have posted C++ code or question to a C
group? Please post C++ questions in <news:comp.lang.c++>.
 
M

Martin Ambuhl

George2 said:
Hello everyone,


I think the value_type of vector<int> should be int and the value_type
of vector<int> should be int*. But I am not 100% sure,

'vector<int>' is a syntax error in C. You probably want a newsgroup for
a different language, perhaps one where 'value_type' actually has a meaning.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top