fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char *name[][7]={"sachin","kapil","dravid"};
  8. int l=0;
  9. l=strlen(name[1]);
  10. cout<<l;
  11. // your code goes here
  12. return 0;
  13. }
Compilation error #stdin compilation error #stdout 0s 16048KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:44: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  char *name[][7]={"sachin","kapil","dravid"};
                                            ^
prog.cpp:7:44: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
prog.cpp:7:44: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
prog.cpp:9:18: error: ‘strlen’ was not declared in this scope
  l=strlen(name[1]);
                  ^
stdout
Standard output is empty