summaryrefslogtreecommitdiff
path: root/c_seguridad/code/strcmp.c
diff options
context:
space:
mode:
authorGuillermo Ramos2013-05-27 00:07:01 +0200
committerGuillermo Ramos2013-05-27 00:07:01 +0200
commit45ec0c7e1bfd251e13f4d3ade89785e98df31ba9 (patch)
tree1f9b534ed4ea650517c39799f5e2aed0885ce87d /c_seguridad/code/strcmp.c
downloadacm-45ec0c7e1bfd251e13f4d3ade89785e98df31ba9.tar.gz
Diffstat (limited to 'c_seguridad/code/strcmp.c')
-rw-r--r--c_seguridad/code/strcmp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/c_seguridad/code/strcmp.c b/c_seguridad/code/strcmp.c
new file mode 100644
index 0000000..23ab60a
--- /dev/null
+++ b/c_seguridad/code/strcmp.c
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <string.h>
+
+int main() {
+ char str1[] = "aaaa";
+ char str2[] = "aaaa";
+
+ if (strcmp(str1, str2) == 0)
+ printf("strcmp: Son iguales\n");
+ else
+ printf("strcmp: No son iguales\n");
+
+ if (str1 == str2)
+ printf("==: Son iguales\n");
+ else
+ printf("==: No son iguales\n");
+
+ return 0;
+}