Jump to content



Photo
- - - - -

Trouble in C


  • Please log in to reply
4 replies to this topic

#1 GodOfCows

GodOfCows

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male

  • Calculators:
    fx-9860gii, fx-9750gii, TI-92, TI-89, TI-83 Plus

Posted 06 April 2018 - 12:17 AM

Hi, I'm unsure why I'm getting a 'Number of parameters mismatch' for the following code (SDK):

I'm new to C. Anyone know whats going on?

int a=12;
int AddIn_main(int isAppli, unsigned short OptionNum)
{
    unsigned int key;

    Bdisp_AllClr_DDVRAM();

    locate(1,4);
     Print((unsigned char*)"%d", a);
   

    while(1){
        GetKey(&key);
    }

    return 1;
}


 


Edited by GodOfCows, 06 April 2018 - 01:40 AM.


#2 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 08 April 2018 - 04:54 AM

Hi GodOfCows,
It is necessary to use sprintf. :) 
#include <stdio.h>

int a=12;
int AddIn_main(int isAppli, unsigned short OptionNum)
{
    unsigned int key;
  char buffer[16];

    Bdisp_AllClr_DDVRAM();

    locate(1,4);
    sprintf(buffer, "%d", a);
    Print((unsigned char*)buffer);
   

    while(1){
        GetKey(&key);
    }

    return 1;
}

 



#3 GodOfCows

GodOfCows

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male

  • Calculators:
    fx-9860gii, fx-9750gii, TI-92, TI-89, TI-83 Plus

Posted 10 April 2018 - 03:48 PM

Thanks!



#4 GodOfCows

GodOfCows

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male

  • Calculators:
    fx-9860gii, fx-9750gii, TI-92, TI-89, TI-83 Plus

Posted 13 April 2018 - 03:03 AM

 

Hi GodOfCows,
It is necessary to use sprintf. :) 
#include <stdio.h>

int a=12;
int AddIn_main(int isAppli, unsigned short OptionNum)
{
    unsigned int key;
  char buffer[16];

    Bdisp_AllClr_DDVRAM();

    locate(1,4);
    sprintf(buffer, "%d", a);
    Print((unsigned char*)buffer);
   

    while(1){
        GetKey(&key);
    }

    return 1;
}

 

Hi, I thank you for your reply, but I get an error when I run the code. I was wondering if you know what it could be:

"System ERROR

REBOOT      :[EXIT

INITIALIZE:EXE

TLB ERROR!!

TERGET=00005D9D

PC         =00001000

"

again, thanks for the reply



#5 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 13 April 2018 - 12:09 PM

Hi, I thank you for your reply, but I get an error when I run the code. I was wondering if you know what it could be:

"System ERROR

REBOOT      :[EXIT

INITIALIZE:EXE

TLB ERROR!!

TERGET=00005D9D

PC         =00001000

"

again, thanks for the reply

Please try this. :)
It has been checked. 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users