lawd help meh

This commit is contained in:
2023-08-20 15:38:49 +03:00
parent 1c607342b4
commit 64070c8152
4 changed files with 59 additions and 12 deletions

View File

@@ -1,23 +1,51 @@
#include "main.h"
#include <stdarg.h>
#include<stdarg.h>
int _printf(const char *format, ...)
{
unsigned int thingies; /*how many %* that aren't %*/
char *buffer;
int i;
va_list stuff;
int i = 0;
int BUFF_SIZE = _strlen(format);
unsigned int identifiers; /* how many %* that aren't %% */
va_list args;
thingies = _contains(format, '%');
va_start(stuff, format);
BUFF_SIZE = _strlen(format);
char* buffer[BUFF_SIZE];
/* Number of Identifiers */
identifiers = _contains(format, '%');
va_start(args, format);
if (!format)
return (0);
while(format)
{
if (*format)
if (*format == '%')
{
switch (*(format + 1))
{
case 's':
break;
case 'c':
break;
case '%':
break;
}
/*
* something something increment i
* by size of argument value
* also no forgor about realloc
*/
}
else
{
/* ERROR SCREAMING AT ME PLS HELP */
*(buffer + i) = (format + i);
i++;
}
}
return (identifiers);
}