am using visual studio 6 on Windows Xp. I have problem while using Vector class:
I am reading a char* from the user input for say 10 times (num_InstanceIds = 10)
char* tempPtr ;
for(unsigned int i = 0; i < num_InstanceIds; i++)
{
fprintf (stdout, " Enter the Instance id %d:", i+1);
// GetChar will return *char type from the user input
tempPtr = GetChar(" ", "");
// tempPtr is not getting inserted in the vector ?
m_InstancedIds.push_back(tempPtr);
// I tried various things in the above line
}
STD::vector <char>::iterator v1_Iter;
for ( v1_Iter = m_InstancedIds.begin( ) ; v1_Iter != m_InstancedIds.end( ) ; v1_Iter++ )
{
fprintf (stdout, "\n");
fprintf (stdout, " Vector is %s:", *v1_Iter);
}
Authored by: rama_krishna
I am reading a char* from the user input for say 10 times (num_InstanceIds = 10)
char* tempPtr ;
for(unsigned int i = 0; i < num_InstanceIds; i++)
{
fprintf (stdout, " Enter the Instance id %d:", i+1);
// GetChar will return *char type from the user input
tempPtr = GetChar(" ", "");
// tempPtr is not getting inserted in the vector ?
m_InstancedIds.push_back(tempPtr);
// I tried various things in the above line
}
STD::vector <char>::iterator v1_Iter;
for ( v1_Iter = m_InstancedIds.begin( ) ; v1_Iter != m_InstancedIds.end( ) ; v1_Iter++ )
{
fprintf (stdout, "\n");
fprintf (stdout, " Vector is %s:", *v1_Iter);
}
Authored by: rama_krishna