Calculator Community > Calculator C
[TIGCC] C strange 16x16 sprite error?
Liazon:
I forget how you typecast, but what's the point of typecasting data?
MathStuf:
I see a problem... You are not testing whether the strings are the same correctly. The right way is:
c1-->CODE ec1if(!strcmp(string_1, string_2))
{
// strings are the same
}
else
{
// strings are different
}c2ec2
That should help some. Turning on Grayscale would too.
In addition, you can't do arguments that way in C for the calcs. You need argv/argc and stuff like that (I'm not quite sure how to use them).
Ranman:
QuoteBegin-MathStuf+Mar 21 2006, 17:51-->QUOTE (MathStuf @ Mar 21 2006, 17:51)In addition, you can't do arguments that way in C for the calcs. You need argv/argc and stuff like that (I'm not quite sure how to use them).
Good catch MathStuf!
I thought the main entry point always had to have the following signature (or prototype):
c1-->CODE ec1void _main(void)c2ec2
Can you pass parameters into _main? Do you have to do something special with the TIGCC startup code to actually pass the parameter into _main?
The standard main entry point for most computer based applications looks something like this:
c1-->CODE ec1main(int argc, char *argv[ ])c2ec2
- argc : this is the number of strings that the argv array contains.
- argv : this is an array of strings.
saubue:
QuoteBegin-Ranman+-->QUOTE (Ranman)Can you pass parameters into _main? Do you have to do something special with the TIGCC startup code to actually pass the parameter into _main?
Of course you can :)
The functions neccessary to do this kind of stuff can be found in the header http://tigcc.ticalc.org/doc/args.html
TIGCC also offers an example program:
c1-->CODE ec1// An example of passing arguments to C program
// Try this program calling argtest(arg1,arg2,...)
#define USE_TI89
#define USE_TI92PLUS
#define USE_V200
#define MIN_AMS 100
#include
#include
#include
#include
void _main(void)
{
Ranman:
Thanks for that example Saubue! :D I did not know that. :oops:
You're never too old to learn something new. ;)
However, the example does show that you don't pass the data directly into _main via parameters; rather that _main must go get the data from some location maintained by the AMS through the use of specialized functions.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version