Search:

Type: Posts; User: tonyp12

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. I like char* as the type is a char-pointer. ...

    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.
  2. Replies
    4
    Views
    646

    Tell the school they failed to teach you (ask for...

    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...
  3. Pointers have a type, so ++ and +=1 means...

    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....
  4. Replies
    11
    Views
    2,012

    * in C is the same thing as: 0x00(R15) in asm ...

    * 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...
  5. Replies
    3
    Views
    720

    This is how I did it that is good for 400 years,...

    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...
  6. Replies
    5
    Views
    451

    parity check is how many bits are 1 and if that...

    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...
  7. I use IAR Workbench In high optimization it's...

    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...
  8. emulate atomic copy and clear volatile give warnings not using it results in 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...
  9. Replies
    3
    Views
    2,257

    The delimiters argument is a string that...

    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...
  10. Replies
    16
    Views
    1,371

    I know . vs -> it's not the same I'm saying the...

    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...
  11. Replies
    12
    Views
    7,559

    '\t' is not even close to how it sees "\t" ' '...

    '\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...
  12. Replies
    16
    Views
    1,371

    (char *) is to change type cast, as C for your...

    (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],

    ->...
  13. Replies
    3
    Views
    2,876

    Calling something void-function show that you...

    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){...
  14. Replies
    3
    Views
    856

    I was thinking that maybe you should create a bit...

    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,...
  15. So in other words you want to treat it as a...

    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 =...
  16. Switch&Case anonymous case number and forward declaration macro/precompiler

    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...
  17. So the cards are sorted before you call the...

    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...
  18. Replies
    6
    Views
    1,620

    Setting a unsigned int to -1, I think most...

    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...
  19. Replies
    9
    Views
    736

    Where are these digits displayed? computer cmd...

    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...
  20. Replies
    9
    Views
    736

    Have you done any programming before, like in...

    Have you done any programming before, like in BASIC?
    What you're asking for is pretty much two: if (speed >130) printf warning.
  21. Replies
    17
    Views
    1,168

    So you want first non a-z/A-Z letter to invoke a...

    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...
  22. Replies
    13
    Views
    1,663

    >char cities[x][y]; I think I already said C...

    >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}; //...
  23. Replies
    12
    Views
    587

    The define is a macro and it simple inserts the...

    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...
  24. Replies
    13
    Views
    1,663

    C is bare to the metal language (a good thing)...

    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...
  25. Replies
    5
    Views
    1,052

    Just something simple to keep track at what state...

    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 ...
Results 1 to 25 of 68
Page 1 of 3 1 2 3