13.07.2015 Views

DSP56xxx C Cross-Compiler User's Guide - Tasking

DSP56xxx C Cross-Compiler User's Guide - Tasking

DSP56xxx C Cross-Compiler User's Guide - Tasking

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Language Implementation 3–79int printpstring( _packed char *p ){int idx = 0;char c;while( c = _pstr_get( p, idx++ ) )putchar( c );return( idx );}void main( void ){int parm;#pragma pack_strings// make packed strings// of all string constantsprintpstring( ”Continue? (Y/N): ” );parm = getchar();printpstring( ”Action: ” );printpstring( parm == ’Y’ ? ”Continuing” :”Stopping” );#pragma nopack_strings}sizeof( _packed char )sizeof( char )_packed char *p = ”123456789”;char *n = ”123456789”;. . .char c;c = _pstr_get( p, 1 ); // c will be ’1’p++;c = _pstr_get( p, 1 ); // c will be ’4’c = *n; // c will be ’1’n++;c = *n; // c will be ’2’• • • • • • • •

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!