Thanks laser salem and algor, this has been quite helpful. Now it's way more clear. I also greatly appreciate algor's code example to handle this better.
As far as my code goes, I'm not building...
Type: Posts; User: mike65535
Thanks laser salem and algor, this has been quite helpful. Now it's way more clear. I also greatly appreciate algor's code example to handle this better.
As far as my code goes, I'm not building...
If I test my sscanf with a test message
strcpy(msg,"GPGGA,,,,,,0,00,99.99,,,,,,*48");
I get a return of 0
A more complete test message works better -
strcpy(msg,...
Without turning your code on its head, you might want to test the choices as the user enters them rather than waiting until the end (it's rather annoying to the user to be told the first question was...
OK, I'm not getting a return of '-1' any more. So msg is valid but not a valid "msg" LOL.
Thanks.
But... I am getting a return of '0'.
1) If msg has more fields in it than the format string in...
Thanks, both posts were quite helpful!
OK, so... let me get this straight. The '-1' means I'm not really passing it a valid msg ?
I've got some sample code that I'm trying to get working / understand.
The sample code has a line:
if(sscanf(msg, "GPGGA,%f,%f,%c,%f,%c,%d,%d,%f,%f,%c,%f", &time, &latitude, &ns, &longitude,...
You said you need to use compare_dates(). Are you having trouble understanding how it works?
Are there are specific parts of your code that you don't understand?
There's a lot of code there. ...
>> the compiler was confused by an earlier error
This is an important thing to learn. When you get bombarded with compile errors, you can fix several simple/obvious errors together at once, but...
This troubles me:
Do you mean if the pointer has some specific value for req, or do you mean does it have ANY value?
Unfortunately, much of the potential help here will have trouble with the non-English functions, comments and variable names. Can you re-write?
And... I, at least, don't know the "snake" problem....
Until you can get a simple example working why muddle the learning experience with more stuff?
C'mon, this is the most basic stuff.
If you want to pass "func" a parameter you put the parameter in the parens
func(45);
func(myvariable);
etc.
You call a function with its name.
If you have a function called "func" (as you do), you call it in main() by the line
func();
(In your case you need to pass it a parameter)
How about telling us the output you want to see, and the output you are getting?
Goodness, where did this code come from?
You don't need to identify or call functions with "func" (as it seems perhaps you believe?)
If you are having trouble understanding function calls,...
subsequences in C program - Stack Overflow
It doesn't seem you actually asked a question.
I see you have a function, decimalPlace(), that appears to generate a value that is meant to be used, I assume, as the "width" of a column, and thus...
OK, so what's the question? Does your code not work? not compile?
It would be better if you published a complete (compilable) code and a specific question.
(I noticed you try to access an...
Yes, this isn't a (typical) series in which the terms get smaller and smaller.
Are you saying you have no preprocessor? Nothing to handle #ifdef's? Or that it's not an option to choose different #defines at compile time?
If that's the case, you need a sort of "discovery"...
Maybe you can get us up to date by (re)posting the code and your specific question(s)?
scanf("%s",&string)
The Patriot Missile Failure
I'm hoping he simplified it to demonstrate the issue he was having with mixing floats and ints.
You'll find out the hard way that c really sucks when you try to mix integers and floats.
Try this:
uitkomst = 1.0 / teller;