In C++ programming i was passing string as pointer
Code:
#include<iostream>
using namespace std;
void changeString(string *s) {
// change s[1] to 'a' inside this function
}
int main(void) {
string s = "ayush";
changeString(&s);
cout<<s;
}
i wrote code *s[1] = 'a', but it is showing error. how do i access first character of string inside function "changeString" . please help any support is appreciated.