Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Comparing Strings | Common String Operations
/
C Strings
Sección 3. Capítulo 4
single

single

bookChallenge: Comparing Strings

Desliza para mostrar el menú

After learning how to compare strings in C using standard library functions, you are ready to apply these concepts in a practical scenario. Comparing strings is a common operation, whether you are checking for equality or determining which string comes first in dictionary order. This challenge will reinforce your understanding and help you interpret the results of string comparison functions.

Tarea

Swipe to start coding

Practice using string comparison functions in C by implementing a function that checks if two strings are equal, or determines which one is lexicographically greater.

  • Use a string comparison function to compare str1 and str2.
  • If the strings are equal, return 0.
  • If str1 is lexicographically less than str2, return -1.
  • If str1 is lexicographically greater than str2, return 1.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 4
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt