How can I add an error to the perror stack?
here is an example of what I want
#include <stdio.h>
#include <stdlib.h>
int Div (int a, int b, int * c) {
if (b == 0) {
// add to perror: "cannot divide by zero!"
return 0;
}
*c = a / b;
return 1;
}
int main () {
int n;
if (!Div(2, 0, &n)) {
perror("could not divide");
}
return 1;
}