fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6.  
  7. char c[]= "GATE2017";
  8. char *p=c;
  9. cout<<p+p[3]-p[1]<<endl; // ??
  10. cout<<p[3]<<endl; // OK
  11. cout<<p[4]<<endl; //OK
  12. cout<<p[7]<<endl; //OK
  13. cout<<p[3]-p[1]; // ??
  14. cout<<p+p[1];
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
2017
E
2
7
4