#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
Go to the source code of this file.
|
char * | concat (char *str,...) |
|
int | main (void) |
|
- cviceni na variadic args se zarazkou, stejny typ argumentu
- Note: nelze funkce(...)
- Note: u C99 mame variadicka makra!!! #define makrargs(...) ..._VA_ARGS__
Dalsi varianty:
- concat do bufferu dodaneho volajicim
- join retezcu se separatorem
Definition in file concat.c.
char* concat |
( |
char * |
str, |
|
|
|
... |
|
) |
| |
spoji ruzny pocet retezcu ukoncenych zarazkou NULL.
- Parameters
-
str | prvni parametr musi byt uveden |
- Todo:
- pokud str==NULL vracime ""?
- Returns
- nove alokovany retezec spojenych parametru
Definition at line 26 of file concat.c.
36 while (pch = va_arg(args,
char *)) {
39 result = (
char*)malloc(len+1);
44 while (pch = va_arg(args,
char *)) {