sprintf conversion lacks type at end of format

By Michael Kiroff

I’m using sprintf in my C program and I’m trying to format a string.

Here is my code:

sprintf(string, "| %-5%lu | %-9%s | %-9%s | %c | %-4%f |", currentPtr->s.SID, currentPtr->s.lname, currentPtr->s.fname, currentPtr->s.initial, currentPtr->s.GPA);

And I keep getting a the warning:

warning: conversion lacks type at end of format [-Wformat]

Why am I getting this warning?

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273