I'm having trouble making a variable argument function for my class. When I gcc it, its giving me these errors:
my_printf.c: In function `print_str':
my_printf.c:14: error: syntax error before '{' token
my_printf.c:20: error: syntax error before "__builtin_stdarg_start"
here's a code snippet:
#include <stdio.h>
#include <stdarg.h>
#include "my_io.h"
// ASCII definitions
#define NEWLINE 10
#define BACKSLASH 92
#define QUOTE 39
#define QUOTES 34
#define QUESTION 63
int my_printf(char *string_ptr, ...)
{
va_list ap;
int integer;
char character;
char *char_string;
va_start(ap, string_ptr);
}
does anyone know whats wrong?