Technical discussions about Freescale (Motorola) DSPs (including the DSP56000, DSP56300, DSP56600, 56800 DSPs).
|
Using CW 4.06 As I step thur (using step into) my code... When putchar is xcuted it enters the putchar function once and successfully prints the first character of my string to stdout. Next time putchar is xcuted it does not enter the actual function and there's no output to stdout. printf functions however works. Below is the code. Thanks Joe void printstring(c *) int main(void) {char mystring[50]; char *charpointer; strcpy(mystring,"Its a super day"); charpointer=mystring; printstring(char *xcharpointer); } void printstring(char *xcharpointer) {do {putchar(*xcharpointer++); //printf("%c",*xcharpointer++); } while (*xcharpointer != NULL); putchar("\n"); } |
|
|
|
Joe McCarron wrote: > Using CW 4.06 > As I step thur (using step into) my code... > When putchar is xcuted it enters the > putchar function once and successfully prints the first character of > my string to stdout. Next time putchar is xcuted it does not enter > the actual function and there's no output to stdout. printf > functions however works. Below is the code. I tried to correct your code and made an example for my testing. As far as I can tell the problem is just that standard i/o is line buffered by default and you are not flushing the buffer. Perhaps a call to fflush after the putchar function will give you the behavior you want. If that doesn't get it I'd need to full example project for the project settings, etc. Ron > Thanks Joe > > void printstring(c *) > int main(void) > {char mystring[50]; > char *charpointer; > > strcpy(mystring,"Its a super day"); > charpointer=mystring; > printstring(char *xcharpointer); > } > void printstring(char *xcharpointer) > {do > {putchar(*xcharpointer++); > //printf("%c",*xcharpointer++); > } > while (*xcharpointer != NULL); > putchar("\n"); > } > _____________________________________ > /groups.php3 -- Do what you do best and let Metrowerks do the rest !! http://www.metrowerks.com/MW/Services/SSG/default.htm Metrowerks, maker of CodeWarrior - "Software Starts Here" Ron Liechty - - http://www.metrowerks.com |