fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. string name = "esha";
  7. char *p, *q;
  8. p = &name[0];
  9. q = &name[3];
  10.  
  11. cout << q - p << endl;
  12. }
Success #stdin #stdout 0s 4440KB
stdin
Standard input is empty
stdout
3