Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.
We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.
Thank you for your understanding.
can u make a counter for 0-9999 with c ?
> i got sum code .here it is when u need it. > > for ( i = 0 ; i != 9999 ; i = i + one ) > > ; > > i = 9999 ;
I have a quicker solution:
int i=0; while(i++<9999);
or, the hard way:
int *i=(int *) malloc(sizeof(int)); memset(i, 0, sizeof(int)); while(*i++<9999);
or ... after reading your code ... a much quicker solution:
int i = 9999;
*smile*
BR, /th.
int i=0; while( i++ < 9999 );
Although the source code may be briefer, it is rather unlikely that the generated machine code will be any different at all...
*pssschhhht* ...he doesn't know that! ;-)
Since we're now giving him the answers, here's the one I was going to suggest:
#define TWO 1 ... int i; i = 0; loop: i = i + TWO; if (i > 9999) goto end; goto loop; end: ...
whoops ...
#define Z 0 #define N 9999 #define F for #define I int #define B break #define C if I i=Z; F(;;) C(i++>N) B;
:-)
wtf? www.linkedin.com/.../b06
/* **====================================================================== ** My_Counter **====================================================================== ** ** Counts to MAX_COUNT and returns the MAX_COUNT value. ** **---------------------------------------------------------------------- ** ** Parameters Passed: <void> ** Parameters Returned: u16 -- the counted value ** Notes: ** ** 'ramble( )' expands to 9999 words of boredom. ** **---------------------------------------------------------------------- */ u16 My_Counter( void ) { ramble( 9999 ); // lots of comments }
--Cpt. Vince Foster 2nd Cannon Place Fort Marcy Park, VA
You don't say - this is a central part of a guidance system of some kind :-)
So what "code monkey" wrote this, then?
** Parameters Returned: u16 -- the counted value
I'm sure your famous book must note somewhere that misleading and/or incorrect comments can often be worse than no comments at all...
But in line with the code quality we expect in this thread, ramble is
#define ramble return random_boring_dictionary_lookups
Thanx Malund Erik U are funny engineer! U said u use SILABS in your projects how do u interface CRYSTAL to your hardware? do u use serial or usb port or I/O card compatible with it? Do u have any manual of it for a beginner person like me! Things that I always like to learn is interfacing my hardware to cores through USB and SERIAL port can u hapl me in this field?
for a new subject start a new thread
U are funny engineer!
I do not know 'U' or is it 'micro' if he is that funny, share some of his jokes
Erik
Just a case of improper use of language. Everyone knows that "are" is a one-letter word...