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

Vorbereitung 14.11.2019

parent 9fac6e4f
No related branches found
No related tags found
No related merge requests found
Showing
with 342 additions and 0 deletions
#include <avr/io.h>
int main (void)
{
DDRD = 0x40; /* binär: 0100 0000 */
PORTD = 0x00; /* binär: 0000 0000 */
while (1);
return 0;
}
#include <stdio.h>
int main (int argc, char **argv)
{
printf ("argc = %d\n", argc);
for (int i = 0; i < argc; i++)
printf ("argv[%d] = \"%s\"\n", i, argv[i]);
return 0;
}
#include <stdio.h>
int main (int argc, char **argv)
{
printf ("argc = %d\n", argc);
for (int i = 0; *argv; i++, argv++)
printf ("argv[%d] = \"%s\"\n", i, *argv);
return 0;
}
#include <stdio.h>
int main (int argc, char **argv)
{
printf ("argc = %d\n", argc);
int i = 0;
while (*argv)
printf ("argv[%d] = \"%s\"\n", i++, *argv++);
return 0;
}
20191107/photo-20191107-172458.jpg

95.2 KiB

#include <stdio.h>
#include <string.h>
int main (void)
{
char hello[] = "Hello, world!\n";
printf ("%s\n", hello);
printf ("%zd\n", strlen (hello));
/*
printf ("%s\n", hello + 7);
printf ("%zd\n", strlen (hello + 7));
hello[5] = 0;
printf ("%s\n", hello);
printf ("%zd\n", strlen (hello));
*/
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton1 = "Anton";
char *anton2 = "anton";
char *zacharias1 = "Zacharias";
char *zacharias2 = "zacharias";
printf ("%d\n", strcmp (anton2, zacharias1));
printf ("%d\n", strcmp (anton2, zacharias2));
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton = "Anton";
char *zacharias = "Zacharias";
printf ("%d\n", strcmp (anton, zacharias));
printf ("%d\n", strcmp (zacharias, anton));
printf ("%d\n", strcmp (anton, anton));
char buffer[100] = "Huber ";
strcat (buffer, anton);
printf ("%s\n", buffer);
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton = "Anton";
char *zacharias = "Zacharias";
printf ("%d\n", strcmp (anton, zacharias));
printf ("%d\n", strcmp (zacharias, anton));
printf ("%d\n", strcmp (anton, anton));
char buffer[] = "Huber ";
strcat (buffer, anton);
printf ("%s\n", buffer);
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton = "Anton";
char *zacharias = "Zacharias";
printf ("%d\n", strcmp (anton, zacharias));
printf ("%d\n", strcmp (zacharias, anton));
printf ("%d\n", strcmp (anton, anton));
char buffer[] = "Huber ";
strcat (buffer, anton);
strcat (buffer, anton);
strcat (buffer, anton);
strcat (buffer, anton);
strcat (buffer, anton);
printf ("%s\n", buffer);
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton = "Anton";
char *zacharias = "Zacharias";
printf ("%d\n", strcmp (anton, zacharias));
printf ("%d\n", strcmp (zacharias, anton));
printf ("%d\n", strcmp (anton, anton));
char buffer[20] = "Huber ";
strncat (buffer, anton, 20);
strncat (buffer, anton, 20);
strncat (buffer, anton, 20);
strncat (buffer, anton, 20);
strncat (buffer, anton, 20);
printf ("%s\n", buffer);
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char buffer[100] = "";
sprintf (buffer, "Die Antwort lautet: %d", 42);
printf ("%s\n", buffer);
/*
char *answer = strstr (buffer, "Antwort");
printf ("%s\n", answer);
printf ("found at: %zd\n", answer - buffer);
*/
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char buffer[100] = "";
snprintf (buffer, 100, "Die Antwort lautet: %d", 42);
printf ("%s\n", buffer);
/*
char *answer = strstr (buffer, "Antwort");
printf ("%s\n", answer);
printf ("found at: %zd\n", answer - buffer);
*/
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char hello[] = "Hello, world!\n";
printf ("%s\n", hello);
printf ("%d\n", strlen (hello));
/*
printf ("%s\n", hello + 7);
printf ("%zd\n", strlen (hello + 7));
hello[5] = 0;
printf ("%s\n", hello);
printf ("%zd\n", strlen (hello));
*/
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char hello[] = "Hello, world!\n";
printf ("%s\n", hello);
printf ("%zd\n", strlen (hello));
printf ("%s\n", hello + 7);
printf ("%zd\n", strlen (hello + 7));
/*
hello[5] = 0;
printf ("%s\n", hello);
printf ("%zd\n", strlen (hello));
*/
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char hello[] = "Hello, world!\n";
printf ("%s\n", hello);
printf ("%zd\n", strlen (hello));
printf ("%s\n", hello + 7);
printf ("%zd\n", strlen (hello + 7));
hello[5] = 0;
printf ("%s\n", hello);
printf ("%zd\n", strlen (hello));
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton = "Anton";
char *zacharias = "Zacharias";
printf ("%d\n", strcmp (anton, zacharias));
printf ("%d\n", strcmp (zacharias, anton));
printf ("%d\n", strcmp (anton, anton));
/*
char buffer[100] = "Huber ";
strcat (buffer, anton);
printf ("%s\n", buffer);
*/
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton = "Anton";
char *zacharias = "Zacharias";
printf ("%d\n", strcmp (anton, zacharias));
printf ("%d\n", strcmp (zacharias, anton));
printf ("%d\n", strcmp (anton, anton));
if (anton == anton)
printf ("gleich\n");
else
printf ("ungleich\n");
/*
char buffer[100] = "Huber ";
strcat (buffer, anton);
printf ("%s\n", buffer);
*/
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton = "Anton";
char *zacharias = "Zacharias";
printf ("%d\n", strcmp (anton, zacharias));
printf ("%d\n", strcmp (zacharias, anton));
printf ("%d\n", strcmp (anton, anton));
char anton2[] = "Anton";
if (anton == anton2)
printf ("gleich\n");
else
printf ("ungleich\n");
/*
char buffer[100] = "Huber ";
strcat (buffer, anton);
printf ("%s\n", buffer);
*/
return 0;
}
#include <stdio.h>
#include <string.h>
int main (void)
{
char *anton = "Anton";
char *zacharias = "Zacharias";
printf ("%d\n", strcmp (anton, zacharias));
printf ("%d\n", strcmp (zacharias, anton));
printf ("%d\n", strcmp (anton, anton));
char *anton2 = "Anton";
if (anton == anton2)
printf ("gleich\n");
else
printf ("ungleich\n");
/*
char buffer[100] = "Huber ";
strcat (buffer, anton);
printf ("%s\n", buffer);
*/
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment