Skip to content

pscanf.h [v2.0]

Latest
Compare
Choose a tag to compare
@MrDave1999 MrDave1999 released this 12 Sep 21:42
· 3 commits to master since this release
429896f

En esta versión puedes declarar una variable de tipo string sin tener la necesidad de especificar el tamaño.
Si antes hacías esto:

#include <stdio.h>

int main()
{
	char name[24];
	printf("Ingrese un string: ");
	fgets(name, 24, stdin);
	return 0;
}

Con P-Scanf lo harías de esta forma:

#include <stdio.h>
#include <pscanf.h>

int main()
{
	string name = { NULL };
	strread(&name, "Ingrese un string: ");
        sfree(); //Para liberar la memoria.
        pause();
	return 0;
}