Skip to content
Snippets Groups Projects
Commit 4cbcc123 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

initial revision

parents
Branches 2015ss
No related tags found
No related merge requests found
Showing
with 170 additions and 0 deletions
#include <stdio.h>
int main (void)
{
typedef char string5[5];
string5 *p = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", &p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
typedef char string5[5];
char **p0 = { "Dies", "ist", "ein", "Test" };
char *p1[] = { "Dies", "ist", "ein", "Test" };
string5 *p = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", &p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
typedef char *string5[5];
char **p0 = { "Dies", "ist", "ein", "Test" };
char *p1[] = { "Dies", "ist", "ein", "Test" };
string5 *p = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", &p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
typedef char string5[5];
char **p0 = { "Dies", "ist", "ein", "Test" };
char *p1[] = { "Dies", "ist", "ein", "Test" };
string5 *p = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%08x %s\n\0 ;)", &p[i], &p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
typedef char string5[5];
char **p0 = { "Dies", "ist", "ein", "Test" };
char *p1[] = { "Dies", "ist", "ein", "Test" };
string5 *p = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%08x %s\n\0 ;)", &p[i], &p[i]);
char *d = p - 10;
for (int i = 0; i < 256; i++, d++)
printf ("%08x: %02hhx %c\n", d, *d, *d);
return 0;
}
#include <stdio.h>
int main (void)
{
typedef char string5[5];
char *p1[] = { "Dies", "ist", "ein", "Test" };
string5 *p = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", &p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
typedef char string5[5];
char *p1[] = { "Dies", "ist", "ein", "Test" };
string5 *p = { "Das", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", &p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
typedef char string5[5];
string5 *p = { "Das", "ist", "ein", "Test" };
char *p1[] = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", &p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
typedef char *string5[5];
string5 p = { "Das", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", p[i]);
return 0;
}
#include <curses.h>
#include <term.h>
int main (void)
{
setupterm (NULL, 1, NULL);
putp (clear_screen);
putp (tgoto (cursor_address, 10, 10));
printf ("Hello, ");
putp (tparm (set_a_foreground, 6));
printf ("world");
putp (tparm (set_a_foreground, 7));
printf ("!\n\n\n\n");
reset_shell_mode ();
return 0;
}
slides/20150423_001.jpg

820 KiB

#include <stdio.h>
int main (void)
{
typedef char string5[5];
string5 *p = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", &p[i]);
return 0;
}
cassini/home/peter/bo/2015ss/es/20150402.0> gcc -std=c99 -Wall -O arrays-42.c -o arrays-42
arrays-42.c: In function ‘main’:
arrays-42.c:6:3: warning: initialization from incompatible pointer type [enabled by default]
arrays-42.c:6:3: warning: (near initialization for ‘p’) [enabled by default]
arrays-42.c:6:3: warning: excess elements in scalar initializer [enabled by default]
arrays-42.c:6:3: warning: (near initialization for ‘p’) [enabled by default]
arrays-42.c:6:3: warning: excess elements in scalar initializer [enabled by default]
arrays-42.c:6:3: warning: (near initialization for ‘p’) [enabled by default]
arrays-42.c:6:3: warning: excess elements in scalar initializer [enabled by default]
arrays-42.c:6:3: warning: (near initialization for ‘p’) [enabled by default]
arrays-42.c:8:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[5]’ [-Wformat]
cassini/home/peter/bo/2015ss/es/20150402.0> ./arrays-42
Dies
;(
cassini/home/peter/bo/2015ss/es/20150402.0>
Farben im Textmodus:
* Bibliothek: curses
(ncurses, pdcurses, ...)
* "Quick and dirty": ANSI-Escape-Sequenzen
C:
printf ("\e[00m\e[01;33m"); /* hellgelb */
printf ("\e[00m\e[01;30m"); /* dunkelgrau */
printf ("\e[00m\e[00;35m"); /* lila */
printf ("\e[00m\e[m"); /* normal */
Unix-Shell:
echo -e "\e[00m\e[00;35m" # hellgelb
echo -e "\e[00m\e[01;33m" # dunkelgrau
echo -e "\e[00m\e[01;30m" # lila
echo -e "\e[00m\e[m" # normal
Weitere Informationen:
http://en.wikipedia.org/wiki/ANSI_escape_sequences
File added
File added
File added
src/721px-Pfs-logo.png

14.5 KiB

src/Adobe-Reader.png

7.05 KiB

File added
src/Microsoft_Power_Point_2010.png

51 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment