summaryrefslogtreecommitdiff
path: root/stories/poetry/MeinVortrag/05.html
blob: e12466701dce5aa9fe0faaa48d72147302c86951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<HTML><HEAD></HEAD><BODY><H1><PRE>
<A HREF="04.html">&lt;-</A><A HREF="06.html">-></A>
int printing( const char *fmt, ...) {
  va_list ap;
  char output[1024];
  
  va_start(ap, fmt);
        
  while( *fmt ) {
    if( *fmt != '%' ) {
        putc( *fmt++ );
    } else { /* Parameter substituieren */
      switch( *++fmt ) {
      case 'd':
          int a = va_arg( ap, int );
          /* Zahl a ausgeben */
          break;
      case 's':
          char *s = va_arg( ap, char *); 
          /* String ausgeben */
      ....
    }
  }
  
  va_end(ap);
}
</PRE></H1></BODY></HTML>