Hello,
I have the following code that prints out only the first char of each string. Why does it not print out the entire unsgined char* ? How can I fix it so that it does?
Regards,Code:#include <iostream> #include <vector> using namespace std; void PrintVector(vector<unsigned char*>& data) { for(size_t i = 0; i < data.size(); i++) { cout << *(data[i]) << endl; } } int main() { vector<unsigned char*> testData; testData.push_back((unsigned char*)"12345678"); testData.push_back((unsigned char*)"AAAAAAAAA"); PrintVector(testData); }
Ellay K.




Reply With Quote