Search:

Type: Posts; User: krkr

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    2,048

    The following assignment is giving compilation...

    The following assignment is giving compilation error(expected identifier)
    int a = 1,2,3;


    But the following is assigning a to 1.
    int a;
    a = 1,2,3;


    Can you help to understand.
  2. Replies
    7
    Views
    2,048

    >> Sometimes this has some use when the left...

    >> Sometimes this has some use when the left operand has a side effect, but in this case it doesn't so there's no point.
    Can you please provide an example for the "," usage when the left operand has...
  3. Replies
    7
    Views
    2,048

    >> Sometimes this has some use when the left...

    >> Sometimes this has some use when the left operand has a side effect, but in this case it doesn't so there's no point.
    Can you please provide an example for the "," usage when the left operand...
  4. Replies
    7
    Views
    2,048

    initializing variable

    I have tried the following program and I am getting output as a:1 b:3. Can someone help me to understand why this behaviour.



    int main()
    {
    int a = 1;2;3;
    int b = (1,2,3);

    ...
  5. Replies
    8
    Views
    8,359

    I got a doubt, what will happen if we assign a...

    I got a doubt, what will happen if we assign a char variable without single quotes. So replaced c = '0x0A' with c=0x0A and printed using %c, I am getting junk value "▒" always. Tried replacing 0x0A...
  6. Replies
    8
    Views
    8,359

    What is the difference between storing '0xAA' and...

    What is the difference between storing '0xAA' and '\xAA' in char.
    My understanding about '0xAA' is, the ASCII value will be stored in memory. But my doubt is, why it prints only 41 during printf,...
  7. Replies
    8
    Views
    8,359

    Shifting an unsigned char

    In the following program I am trying to left shift a char variable.


    int main()
    {
    unsigned char c='0x0A';
    printf("%c", (c << 4));

    return 0;
    }
  8. Replies
    3
    Views
    7,449

    So r9 register will act as a pointer, what ever...

    So r9 register will act as a pointer, what ever value we assign to ptr will be stored in r9 register.
  9. Replies
    3
    Views
    7,449

    Register variable declaration

    What exactly the following declaration will do?

    register int *ptr asm ("r9");


    (OR)
  10. It seems when we give within single quotes then...

    It seems when we give within single quotes then it is taking it as a "ascii character", otherwise it is treating it as "ascii value" in decimal.


    But if we give more than 9 in single quotes then...
  11. Query related to storing ASCII value for characters

    Can you help to understand what will store in "value" variable in the following two cases. When we assign a character then ascii value will be stored, but if we assign value (sat 0 ,1 etc) then what...
  12. Replies
    3
    Views
    2,315

    Thanks for the reply. So we can't initialize a...

    Thanks for the reply.
    So we can't initialize a double pointers?
    Can you guide to understand the usage of double pointers.
  13. Replies
    3
    Views
    2,315

    Usage of double pointers

    Is there any difference between the following two initializations.



    case1)char **ch = {"abc","def"};


    case2)char *ch[] = {"abc","def"};
  14. Replies
    2
    Views
    9,430

    I don't have control on the get_value(). It is a...

    I don't have control on the get_value(). It is a generic function which returns the value of bits at the given bit positions.
  15. Replies
    2
    Views
    9,430

    Is it possible to typecast enum variable in C

    It seems the enum constants are signed int as per C standard, please correct me if it is different.


    Is there anyway to define an enum and typecast to other type say "unsigned int"?


    In the...
  16. Replies
    5
    Views
    1,509

    I couldn't understand Can you please...

    I couldn't understand

    Can you please elaborate a bit.
  17. Replies
    5
    Views
    1,509

    doubt on function pointer using typedef

    As per my understanding following is the syntax for function pointer using typedef.



    typedef void (*fp)(int arg);


    I saw typedef to function definition similar to below.
  18. Thanks for the info.

    Thanks for the info.
  19. Replies
    3
    Views
    1,043

    Thanks for pointing to the post. It explains...

    Thanks for pointing to the post. It explains about tentative definition of object with file scope.

    Will the tentative definitions not applicable to an object with local/block scope and static...
  20. Replies
    3
    Views
    1,043

    Multiple declarations of a variable

    If we declare a global variable multiple times as shown below then it is not giving any issue.



    int i;
    int main()
    {
    printf("%d \n",i);
    return 0;
    }
  21. Issue with pointer to a const char using typedef

    I have declared a pointer to const char and incremented the pointer, it is not giving any issue.

    int main()
    {
    const char * ptr;
    char *c = "ABC";
    ptr = c;
    ptr++;
  22. Replies
    6
    Views
    1,159

    Thanks very much for the information.

    Thanks very much for the information.
  23. Replies
    6
    Views
    1,159

    Hi, This is not homework, I found this...

    Hi,

    This is not homework, I found this initialization in the clock configuration source.
    I have tried with the following sample program also, it is not giving any syntax error.


    #include...
  24. Replies
    6
    Views
    1,159

    constant char pointer declaration

    I come across following initialization in some of the sopurce files.

    static const char const *p[] = {"ABC","DEF",} ;




    As per my understanding ...

    char *p ----> p is...
  25. Replies
    15
    Views
    2,895

    If function name is not conatant then following...

    If function name is not conatant then following program should throw error, because initializers should be constants for static objects. But it is compiling successfully.


    struct ex {
    ...
Results 1 to 25 of 54
Page 1 of 3 1 2 3