Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

146
Vistas
Standard Input C: Incorrect string if $ is present

I am trying to take input from the STDIN. If the input string starts with character '$' then the input is not converted to string as it is.

int main(int argc, char*argv[]){
     printf("%s\n",argv[1]);
}

Can someone please let me know to why C compiler replaces the characters with '0' if it encounters the '$' symbol ?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

It's not your program. It's your shell interpreting it as a variable, then passing its value to your program.

To work around this, escape the $ when you invoke the program from your shell.

./yourprogram '$arg'
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda