sch 0 Posted November 21, 2012 Share Posted November 21, 2012 Hello, I tried void sizes() { char buff[256]; sprintf(buff,"sizeof(char)=%d\n",sizeof(char)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(short int)=%d\n",sizeof(short int)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(int)=%d\n",sizeof(int)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(long int)=%d\n",sizeof(long int)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(long long int)=%d\n",sizeof(long long int)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(float)=%d\n",sizeof(float)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(double)=%d\n",sizeof(double)); SCI_putStr(mySci,buff); } On my serial terminal I see sizeof(char)=0 sizeof(short int)=0 sizeof(int)=0 sizeof(long int)=0 sizeof(long long int)=0 sizeof(float)=0 sizeof(double)=0 what can be wrong? Quote Link to post Share on other sites
msptest6 0 Posted November 27, 2012 Share Posted November 27, 2012 Hello, I tried void sizes() { char buff[256]; sprintf(buff,"sizeof(char)=%d\n",sizeof(char)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(short int)=%d\n",sizeof(short int)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(int)=%d\n",sizeof(int)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(long int)=%d\n",sizeof(long int)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(long long int)=%d\n",sizeof(long long int)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(float)=%d\n",sizeof(float)); SCI_putStr(mySci,buff); sprintf(buff,"sizeof(double)=%d\n",sizeof(double)); SCI_putStr(mySci,buff); } On my serial terminal I see sizeof(char)=0 sizeof(short int)=0 sizeof(int)=0 sizeof(long int)=0 sizeof(long long int)=0 sizeof(float)=0 sizeof(double)=0 what can be wrong? Use %ld Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.