OK, I think I've found the "code is in this post" trigger. It's having any curly braces in it. Below this code is an example of what the output should be. That output uses those at each end of the text string. If I removed those, the board s/w would accept my post. Or I can just wrap the example in code tags... Oh well...
I'm beginning to think I need to start a new search for something I can understand! Found this forum when I discovered an example in this book needed a little help to even work. I'm now wondering if I should NOT be using Xcode to work on the examples.
If someone could paste the following code into a "Command Line Tool" project and make the Type as C, then run the code and let me know if there is correct output in the Console, I would be forever indebted. Well, certainly until the next time I need help, anyway...
Code:
#include <stdio.h>
int main()
{
float latitude;
float longitude;
char info[80];
int started = 0;
puts("data=[ ");
while (scanf("%f, %f, %79[ ^\n]", &latitude, &longitude, info) == 3)
{
if (started)
{
printf(",\n");
} else { /* These braces are Not in original code, but I
don't think that is the cause of the problem.
I have the same issues with or without them. */
started = 1;
}
printf("{latitude: %f, longitude: %f, info: '%s'}", latitude, longitude, info);
}
puts("\n]");
return 0;
}
The input expects numbers (type float) for the Lat and Long: 42.363400 and -73.296301, for example. The last input is a short string like Speed = 21. The output for the example input would be:
Code:
{latitude: 42.363400, longitude: -73.296301, info: 'Speed = 21'}
for each entry of the three items.
Thanks for any help or suggestions.