I like char* as the type is a char-pointer.
After all it is not a char, as then it would be limited to the first 255bytes of memory.
Type: Posts; User: tonyp12
I like char* as the type is a char-pointer.
After all it is not a char, as then it would be limited to the first 255bytes of memory.
Tell the school they failed to teach you (ask for a refund) as you don't have the concepts of basic C yet.
If they really tried when you probably better off to go with a arts major as it looks like...
Pointers have a type, so ++ and +=1 means different things depending if a char/int/long type.
It increases the pointer by one if a char, two if a int.....
Type cast the call to try your luck....
* in C is the same thing as:
0x00(R15) in asm
or some mcu also have @R15 or even @R15+ for the source side
So the pointer without * in front you are changing the address it's pointing to.
The...
This is how I did it that is good for 400 years, though year only have two digits here
rtcstruct rtc = {16,3,22, 13,59,0}; // local year, month, day, hour, min, sec
const char...
parity check is how many bits are 1 and if that is a even number.
Not if the data itself is a even number as ... & 1 would do that.
Some MCU/CPU have hardware instructions that can do that, but...
I use IAR Workbench
In high optimization it's very good at finding shortcuts in math but in this case I don't want its help.
If I don't use volatile and IAR is trying to be "smart" using clr.w...
typedef volatile union eventTag
...
check.all = event.all; // a IRQ could happen between
event.all &= ~check.all; // atomic way to clear it
compiles in to and is safe but compiler...
The delimiters argument is a string that specifies a set of delimiters that may surround the token being extracted.
All the initial bytes that are members of this set are discarded.
The first...
I know . vs -> it's not the same
I'm saying the intentions of the -> is the same as the dot when you use structs without pointers.
explaining it like that helps newbies.
Why the code does what...
'\t' is not even close to how it sees "\t"
' ' is normally only used for char and I'm not even sure how it handles escape and also it does not add a zero byte at the end.
" " compiler places the...
(char *) is to change type cast, as C for your own good don't allow different types to be moved from one to another without your permission that you show with a type cast.
netif->hwaddr[0],
->...
Calling something void-function show that you just started.
void functionname (void); // prototype probably should be in the .h file, forward reference now possible.
void functionname (void){...
I was thinking that maybe you should create a bit to that represent a value and then OR them and then check final result.
array[16]={0,BIT0+BITE, BIT1,...
So in other words you want to treat it as a string and find some special chars like '*' and + and swap it with the byte/char after it.
if (mystring[i] =='*' || mystring[i] =='+') { char temp =...
I use switch & case as a state-machine
I like how I can have break inside a if-statement
and can do instant fall-through when I want it.
First I thought about making all case's anonymous by...
So the cards are sorted before you call the function?
And it's only in straights you having problems that ace 1 or 14?
So you have 2,3,4,5,14
could do if (card[4] == 14){
if (range for cards...
Setting a unsigned int to -1, I think most compilers don't even warn for as it simple use 0xFFFF_FFFF on a 32bit system
So can you not keep them both unsigned?
Show us how you compare timeout to...
Where are these digits displayed? computer cmd window?, windows app, 7digits LED's on Arduino board etc?
The display is the hard part than to show if (speed>130)
So maybe you should use Arduino...
Have you done any programming before, like in BASIC?
What you're asking for is pretty much two: if (speed >130) printf warning.
So you want first non a-z/A-Z letter to invoke a '\n'
anything after that should be ignored until a valid a-z/A-Z again.
the else if is a good way to: if not true and the first time it's not true...
>char cities[x][y];
I think I already said C is NOT a run-time language
allocation of arrays has to be done at compile (maybe at runtime with memalloc etc)
enum {x = 3, y = 40}; //...
The define is a macro and it simple inserts the text/string and is not doing any calculation at the precompile
result = 2 * ADD(5, 4)
result = 2 * 5 + 4; // probably not as intended
So always...
C is bare to the metal language (a good thing)
Everything is compiled in to machine code and nothing is evaluated at run time.
So things like strlen() is just sub-routine where it check byte by...
Just something simple to keep track at what state and when to restart/stop as don't allow other functions/irq to change state but set these flags only.
typedef struct StateTag ...