0x10. C Variadic functions Task 1 - humtej1204/holbertonschool-low_level_programming GitHub Wiki

1. To be is to be the value of a variable

mandatory

Write a function that prints numbers, followed by a new line.

  • Prototype: void print_numbers(const char *separator, const unsigned int n, ...);
  • where separator is the string to be printed between numbers
  • and n is the number of integers passed to the function
  • You are allowed to use printf
  • If separator is NULL, don’t print it
  • Print a new line at the end of your function
julien@ubuntu:~/0x0f. variadic functions$ cat 1-main.c
#include "variadic_functions.h"

/**
 * main - check the code
 *
 * Return: Always 0.
 */
int main(void)
{
    print_numbers(", ", 4, 0, 98, -1024, 402);
    return (0);
}
julien@ubuntu:~/0x0f. variadic functions$ gcc -Wall -pedantic -Werror -Wextra -std=gnu89 1-main.c 1-print_numbers.c -o b
julien@ubuntu:~/0x0f. variadic functions$ ./b
0, 98, -1024, 402
julien@ubuntu:~/0x0f. variadic functions$ 

Repo:

  • GitHub repository: holbertonschool-low_level_programming
  • Directory: 0x10-variadic_functions
  • File: 1-print_numbers.c