Code:
#include <stdio.h>
#include <stdlib.h>
int main(){
printf("%s",strspn("Cows like to moo.","Ceiklosw "));
return 0;
}
The problem appears to be %s. if I change it to be %c it runs, but returns nothing to the screen.
If however I run an example from the book which has a lot of %s in the program, it runs just fine. the samples as c files which I copy and paste. I need to know what's going wrong.
I am using C-Free editor and minGW compiler and the program compiles just fine but when running it gives error in a separate popup window
test.exe has encountered a problem and needs to close.
We are sorry for the inconvenience.
Since I also have VS 2005 loaded there is a debug button and a close button.
DougP
< I Built one