using comma separated strings instead of string arrays...

This commit is contained in:
2021-06-12 13:41:25 +02:00
parent e4f07ffe2f
commit 9d15ec1cae
5 changed files with 54 additions and 21 deletions

View File

@ -3,4 +3,6 @@
#include <stdint.h>
#include <stdlib.h>
void files_exist(const char *const *f, size_t len);
char *files_exist(const char *f);
void free_str(char *s);

View File

@ -1,15 +1,15 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
extern void files_exist(const char *const *f, size_t len);
extern char *files_exist(const char *f);
extern void free_str(char *s);
int main(int argc, char const* argv[])
{
const char *a[2];
a[0] = "Hello";
a[1] = "World!";
files_exist(a, 2);
char *world = "/home/nathan/Downloads/hackerman.jpg,/home/nathan/x.txt";
char *chunk = files_exist(world);
printf("C: %s", chunk);
free_str(chunk);
return 0;
}