Search:

Type: Posts; User: techie_san778

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. 2 similar funtions and 1 function pointer

    Hello Friends,

    The following code has been taken from the sorting example in K&R C Programming book, which employs pointer to function concept.


    void qsort(void *lineptr[ ], int left, int...
  2. Replies
    6
    Views
    472

    Understood. Thanks.

    Understood. Thanks.
  3. Replies
    6
    Views
    472

    Then why is this declaration : int (x[])...

    Then why is this declaration :


    int (x[]) ()

    is read as : x is array of function returning int.
  4. Replies
    6
    Views
    472

    Array of functions ?

    Hello Friends,

    I want to know what is an array of functions and how do we initialize such an array ? Is it the same as array of pointers to functions ?
    Please guide..

    Regards
  5. Replies
    9
    Views
    825

    And here it is : int (*(*((*x)[]))())[]().

    And here it is : int (*(*((*x)[]))())[]().
  6. Replies
    9
    Views
    825

    So, there you are.. of course i should thank u...

    So, there you are.. of course i should thank u for taking pain in explaining things in terms of typedef but i want the correct declaration in the syntax that i have posted. Anyways, i will soon...
  7. Replies
    9
    Views
    825

    Don't get puzzled up. I haven't got it from...

    Don't get puzzled up. I haven't got it from anywhere. I was just a trying to declare x as already discussed in the first post. One tries with so many declarations, concepts.. does it mean that he...
  8. Replies
    9
    Views
    825

    agree, but all i was doing and want to do is...

    agree, but all i was doing and want to do is check if the syntax of what x is supposed to be, is correct.
    What's the effect unless the pointer is const ? The base address of an array is same as the...
  9. Replies
    9
    Views
    825

    Is this declaration correct ?

    hello friends,

    I want to declare x as a pointer to array of pointers to functions returning pointer to array of function pointers. Is this syntax correct ?

    ...
  10. Why both statements give same result ?

    int main()
    {
    char *arr[] = { "Hello", "World", "Good", "Morning", NULL };
    char **ptr = arr;

    printf("\n %u", ptr);
    printf("\n %c", (*++ptr)[0]);
    printf("\n %u", ptr);
    ...
  11. Update : i checked the output with this...

    Update : i checked the output with this modification : printf("%u", *(ptr + row + col)) and it's giving memory addresses. This puzzled me even more. The reason : This construction works well when i...
  12. Thanks Hodor...

    Thanks Hodor !! Some clarifications still needed.. firstly, please let me know the compiler you're using. because, i didn't get any such warning in GCC under Linux. Secondly, i would like to know,...
  13. Reading a 2 Dimensional array with pointer fails !!

    Hello Friends !!

    I am getting weird output when i read a 2 dimensional array with
    pointer :


    int main()
    {
    int arr[2][5] = { {1,2,3,4,5},
    {6,7,9,10,11}
  14. Elkvis, can we say that the size of pointer is...

    Elkvis, can we say that the size
    of pointer is same as size of int on a system ?
  15. Array of string pointers. Each location 4 Bytes away ?

    #include <stdio.h>

    int main()
    {
    char *arr[] = { "hello", "world", "good", "morning" };
    int i;

    for(i = 0; i < 4; i++)
    printf("\n &arr[%d] = %u",i,&arr[i]); //Each...
  16. Replies
    2
    Views
    350

    GReaper...

    GReaper Ohh !! that was so silly !! i meant to write x = 1 but all along i had been running the program with x = 10; Thanks for pointing out the mistake and sorry for the error !! :(
  17. Replies
    2
    Views
    350

    Why no output of the program ?

    Hello Friends !

    Can someone figure out the error in the following code for me. I am
    getting blank output :(



    #include <stdio.h>

    int main()
  18. display() is not a member function of the class....

    display() is not a member function of the class. Then how can we call ob.display() ? This surely will give compilation error.


    int main()
    {
    test t1; //object created;
    t1.display(); //error...
  19. Thanks whiteflags...

    Thanks whiteflags, for the reply. I tried to post the error description yesterday but was getting DB error from the website. Anyways, i had already tested what you have said regarding declaring the...
  20. Compilation error - friend function with no parameters

    #include <iostream>

    using namespace std;

    class abc
    {
    int x;
    friend void display(void);
    };
  21. But why is this happening with only external...

    But why is this happening with only external variables ? In case of local variables, i get segmentation fault. Is there any explanation ?
  22. i checked on windows. I ran a loop 10 times. On...

    i checked on windows. I ran a loop 10 times. On Linux, the output was 0 always. On windows, 0 was most of the time and garbage values the rest of time.
  23. yes algorism, i also think in the same way as...

    yes algorism, i also think in the same way as you. i observed this peculiarity only in case of global variables. I better try it on windows platform and as you said, i will also check with loop. I...
  24. Why there is no runtime error for this code ?

    Hello Friends !!

    I am unable to know why there is no runtime error or segmentation error (in Linux) when i run the following code :



    #include <stdio.h>

    int x = 'A';
  25. Replies
    1
    Views
    335

    Need a clarification on Enums

    Hello Friends !!

    I found a fact about enums from the book : C Programming by Dennis-Ritchie : Please make me understand this by means of a suitable code.

    "Although variables of enum types may...
Results 1 to 25 of 59
Page 1 of 3 1 2 3