Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 5 years ago

Language

C

Compiler

gcc 9.1.0

Options
Warnings
C11(GNU)
-pedantic

Author

anonymous

over 5 years ago

$ gcc prog.c -Wall -Wextra -std=gnu11 -pedantic
prog.c: In function 'main':
prog.c:4:17: warning: initialization of 'char *' from incompatible pointer type 'char (*)[10]' [-Wincompatible-pointer-types]
    4 | char* puntero = &saludo;
      |                 ^
prog.c:6:38: warning: format '%p' expects argument of type 'void *', but argument 2 has type 'char (*)[10]' [-Wformat=]
    6 | printf("La variable saludo esta en: %p \n",&saludo);
      |                                     ~^     ~~~~~~~
      |                                      |     |
      |                                      |     char (*)[10]
      |                                      void *
prog.c:7:12: warning: comparison of distinct pointer types lacks a cast
    7 | if(&saludo == puntero){
      |            ^~
prog.c:10:10: warning: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   10 | *puntero = "Hola";//Modifico a donde apunta mi puntero
      |          ^
Nuestro puntero apunta a: 0x7ffff0f9e18e 
La variable saludo esta en: 0x7ffff0f9e18e 
Las direcciones apuntan al mismo lugar: 0x7ffff0f9e18e 
mmigo
Exit Code:
0