this is a simple question that is quite straightforward.
i want to cout the second character in a pointed string (assuming only strings bigger than size [2] is passed in)
here is the code:
Code:
#include<iostream>
void main(void){
std::string *asd=new std::string;
*asd="asdfg";
std::cout<<*asd[1];
}
and i have this error:
Code:
1 IntelliSense: no operator "*" matches these operands
operand types are: * std::string c:\Users\samsung\Documents\Visual Studio 2012\Projects\ConsoleApplication3\ConsoleApplication3\Source.cpp 5 13 ConsoleApplication3
what's wrong?
help is appreciated!