-1
#include <stdio.h>
#include <string.h>
int main( )
{ 

    char a[]="a b c d e f g",b[10]=" a b c d e f g";
    printf("%d %d\n",sizeof(*a),sizeof(*b));  
    printf("%d %d\n", strlen(*a), strlen(*b));  
    return 0;
}
dbush
  • 186,650
  • 20
  • 189
  • 240
lszz
  • 1
  • Try using `sizeof` on a `char *` (instead of a `char[]`) and you'll see the difference – Alexander May 29 '22 at 15:13
  • The compiler should give you some hints about problems in your code: https://godbolt.org/z/Wqc5fovP3 – mch May 29 '22 at 15:14
  • `strlen` is a function that requires a `char *` argument. So `strlen(*a)` and `strlen(*b)` are invalid, just as your compiler told you. Try `strlen(a)` and `strlen(b)` instead. Also, don't use `%d` to print the result of `sizeof` or `strlen`. Used `%zu` instead. – Tom Karzes May 29 '22 at 15:17
  • Welcome. You should take a look at [ask] and take the [tour], if you have not done so already. Also take a look at [example]. This is general information that you should keep in mind, when asking questions. – cliff2310 May 29 '22 at 15:52

0 Answers0