summaryrefslogtreecommitdiff
path: root/c,cc/ctype.c
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-06-15 03:50:12 +0200
committerPatrick Simianer <p@simianer.de>2014-06-15 03:50:12 +0200
commit258e1b92ebbfdebefabc120969ab87c3d8b75c3d (patch)
treeef4ab11fe0bf9d720cea23b35711358a8465feeb /c,cc/ctype.c
parentcf3a29feb5887344b6633ead1b4b6d5657a15a4b (diff)
old c,cc examples
Diffstat (limited to 'c,cc/ctype.c')
-rw-r--r--c,cc/ctype.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/c,cc/ctype.c b/c,cc/ctype.c
new file mode 100644
index 0000000..0331566
--- /dev/null
+++ b/c,cc/ctype.c
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+
+
+int main(void)
+{
+ char *a="abc";
+ char *x="xyz";
+ char *b="abc";
+ char *y="Xyz";
+
+ int r;
+
+ if(isupper(y[0]))
+ {
+ printf("%c\n",y[0]);
+ }
+
+ if(r=(!strcmp(a,b)))
+ {
+ printf("%d\n",r);
+ }
+
+ printf("%c\n",*x);
+
+ if(r=(!strcmp(a,x)))
+ {
+ printf("%d\n",r);
+ }
+
+ char bla[4]="aAc";
+
+ for( unsigned int i = 0; i < 4; i += 1 )
+ {
+ if(isupper(bla[i])) {
+ printf("%c\n",bla[i]);
+ }
+ }
+
+ return 0;
+}
+