Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vectors....compiler warning

Status
Not open for further replies.

javaguy1

Programmer
May 14, 2003
136
US
i get 3 compiler warning (all about the same thing it seems).
c:\visual studio\vc98\include\vector(60) : warning C4786: they say my identifier was truncated to 255 characters. my vectors will actually hold a little more than that. is this something i should do something about?
 
hmmm dont know what that means. i dont know if it has anything to do with this but when i tried to run the program i got an unhandled exception error....Access violation
 
The warning and the Access violation are not related. The warning is telling your that the compiler truncated the identifier symbol to 255 characters. It has no effect. The pragma will disable the warning.

An access violation means you attempted to write to a memory address that your application did not allocate.

-pete
 
illegal page fault....
do i need to set the size of my vectors or something?
it looks like
#pragma warning (disable, 4786)
disables the warnings
i want to know why im being warned and why the program doesnt run. i didnt try running it until after i first posted.
 
here is my vector declaration in the base class header file
vector<string> vocabulary;
 
i found the problem. i was using a variable in a switch statement that i had failed to initialize and had provided no default case...seems ok now.
 
The reason you're being warned is that you're using a type that, to the compiler, looks something like:

::std::vector<::std::basic_string<char,::std::char_traits<char>,::std::allocator<char> >,::std::allocator<::std::basic_string<char,::std::char_traits<char>,::std::allocator<char> > > >

Which admittedly is pretty long. So it shortens it. Just the name. It has nothing to do with how many elements your vector holds.

As mentioned, this has no effect on the execution of your program. The only thing it might have an effect on is debugging.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top