Search:

Type: Posts; User: krkr

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    485

    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...
  2. Replies
    8
    Views
    485

    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,...
  3. Replies
    8
    Views
    485

    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;
    }
  4. Replies
    3
    Views
    388

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

    Register variable declaration

    What exactly the following declaration will do?

    register int *ptr asm ("r9");


    (OR)
  6. 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...
  7. 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...
  8. Replies
    3
    Views
    722

    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.
  9. Replies
    3
    Views
    722

    Usage of double pointers

    Is there any difference between the following two initializations.



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


    case2)char *ch[] = {"abc","def"};
  10. Replies
    2
    Views
    2,258

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

    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...
  12. Replies
    5
    Views
    677

    I couldn't understand Can you please...

    I couldn't understand

    Can you please elaborate a bit.
  13. Replies
    5
    Views
    677

    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.
  14. Thanks for the info.

    Thanks for the info.
  15. Replies
    3
    Views
    568

    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...
  16. Replies
    3
    Views
    568

    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;
    }
  17. 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++;
  18. Replies
    6
    Views
    648

    Thanks very much for the information.

    Thanks very much for the information.
  19. Replies
    6
    Views
    648

    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...
  20. Replies
    6
    Views
    648

    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...
  21. Replies
    15
    Views
    1,252

    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 {
    ...
  22. Replies
    15
    Views
    1,252

    C compiler will traat function names as string...

    C compiler will traat function names as string constants?
  23. Replies
    15
    Views
    1,252

    I have initialized a static structure with...

    I have initialized a static structure with function name as shown below. I think we can initialize a static structure with constants.
    function names are constants in C?


    struct fp {
    int...
  24. Replies
    15
    Views
    1,252

    As per my understanding scope means a region in...

    As per my understanding scope means a region in code where a variable can be accessed. If we declare a global variable as static then its scope is limited to that file. so using global variable as...
  25. Replies
    15
    Views
    1,252

    Thanks for the information. Is function names...

    Thanks for the information.

    Is function names in C are constants?


    I have defined a structure having function pointers, Created a static object for that and initialized function pointers....
Results 1 to 25 of 50
Page 1 of 2 1 2