Strcmp

Strcmp

Strcmp

Strcmp es una función de C para comparar cadenas de carácteres.

Valor de retorno

La función retorna un número entero mayor, igual, o menor que cero, apropiadamente según la cadena apuntada por str1 es mayor, igual, o menor que la cadena apuntada por str2.


Ejemplo

  1. include <stdio.h>
  2. include <string.h>

int main(){

  char str1[] = "Cadena";
  char str2[] = "cadena";
  printf( "Palabra 1: %s\n", str1 );
  printf( "Palabra 2: %s\n", str2 );
  if( !strcmp( str1, str2 ) ){
     printf("Son iguales.\n");
  }else{
     printf("Son diferentes.\n");
  }
  return 0;

}

Obtenido de "Strcmp"

Wikimedia foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Mira otros diccionarios:

  • strcmp — Dans le langage C, strcmp est une fonction de la bibliothèque standard de C déclarée dans le fichier d en tête string.h permettant de comparer deux chaînes de caractères. Le prototype, suivant la norme ISO/IEC 9899:1999, est le suivant : int …   Wikipédia en Français

  • Strcmp — In POSIX and in the programming language C, strcmp is a function in the C standard library (declared in string.h) that compares two C strings.The prototype according ISO/IEC 9899:1999, 7.21.4.2 :int strcmp(const char *s1, const char *s2);strcmp… …   Wikipedia

  • strcmp — En POSIX y en el lenguaje de programación C, strcmp es una función en la [[biblioteca estánd La función retorna un número entero mayor, igual, o menor que cero, apropiadamente según la cadena apuntada por str1 es mayor, igual, o menor que la… …   Wikipedia Español

  • Interpreter — Ein Interpreter (im Sinne der Softwaretechnik) ist ein Computerprogramm, das einen Programm Quellcode im Gegensatz zu Assemblern oder Compilern nicht in eine auf dem System direkt ausführbare Datei umwandelt, sondern den Quellcode einliest,… …   Deutsch Wikipedia

  • Interpreter (Computer) — Ein Interpreter (im Sinne der Softwaretechnik) ist ein Computerprogramm, das einen Programm Quellcode im Gegensatz zu Assemblern oder Compilern nicht in eine auf dem System direkt ausführbare Datei umwandelt, sondern den Quellcode einliest,… …   Deutsch Wikipedia

  • Interpretersprache — Ein Interpreter (im Sinne der Softwaretechnik) ist ein Computerprogramm, das einen Programm Quellcode im Gegensatz zu Assemblern oder Compilern nicht in eine auf dem System direkt ausführbare Datei umwandelt, sondern den Quellcode einliest,… …   Deutsch Wikipedia

  • Comparison of programming languages (string functions) — String functions redirects here. For string functions in formal language theory, see String operations. Programming language comparisons General comparison Basic syntax Basic instructions Arrays …   Wikipedia

  • Name mangling — This article is about name mangling in computer languages. For name mangling in file systems, see filename mangling. In compiler construction, name mangling (also called name decoration) is a technique used to solve various problems caused by the …   Wikipedia

  • Schablonenmethode — Die Schablonenmethode (engl. template method) ist ein in der Softwareentwicklung eingesetztes Entwurfsmuster, mit dem Teilschritte eines Algorithmus variabel gehalten werden können. Es gehört zur Kategorie der Verhaltensmuster (engl. behavioral… …   Deutsch Wikipedia

  • C syntax — The syntax of the C programming language is a set of rules that specifies whether the sequence of characters in a file is conforming C source code. The rules specify how the character sequences are to be chunked into tokens (the lexical grammar) …   Wikipedia

Compartir el artículo y extractos

Link directo
Do a right-click on the link above
and select “Copy Link”