-
standard library error
I was just compiling a program using visual studio C++ and it gave me an errror saying that size_t was not part of the standard library. Explaining a little bit more in the C standard library there is a standard type size_t which can only be assigned a positive int number.
I have a line of code saying
typedef std::size_t size_type;
which defined the size type as size_t, It didnt give me any errors while running on linux however in visual studio I get an error saying
error C2039: 'size_t' : is not a member of 'std'
Does this mean that maybe my standard libraries in visual studio need an update or is there any other reason why it is giving me this error
Thanx in advance byeeee
-
-
THANX for the post but Im still confused jeje Ill try to update my libraries and see what happens
-
size_t is part of the ANSI C Standard Library, and is of type unsigned int. Check with Microsoft if there are any updates to your libraries and headers that corrects this deviation from ANSI C.
-
youve assigned size_t tp the namespace std. *nix might have just ignnored the namespace and just used the size_t while the windows compiler is a little more stringent.
all size_t is is an usigned ing why dont you just use
typedef unsigned int size_type
*ing should have been int