1
vote
4answers
92 views

Returning arrays and pointers in C?

I'm relatively a beginner in programming in C and am getting super confused with arrays and pointers. Basically what I'm trying to do is extend a string that contains binary to the designated length ...
3
votes
2answers
54 views

“no match for operator->* in pos ->* op”

I am getting the following error while compiling the below code. I am confused and am not able to figure out what is wrong here. Is the member function pointer de-referencing wrong? Error: #g++ ...
-4
votes
4answers
96 views

why can't I pass in variables to implement a swap function?

I just started learning C and I was confused about why do I have to use pointers to implement a swap function? Version where swap does not work: #include <stdio.h> void swap(int i, int j) { ...
2
votes
3answers
67 views

Function Pointer Declaration - what does __P do?

The usual form of function pointer definitions is: int function(int, int); int (*ptr)(int, int); but I saw a form today which I didn't understand. Can anyone explain this please? int (*close) ...
0
votes
1answer
47 views

Returning a pointer is not working fine

When I try to display the content of an array via a pointer returned by a function, the program displays only zeros. I am not sure what is missing. I have tried to check several times what is wrong, ...
1
vote
1answer
39 views

CancelIoEx : Function pointer typedef

The following code is copied from MS Async Filter. It is supposed that the following code is calling either CancelIo or CancelIoEx. I don't see where CancelIoEx is called in anyway. It is supposed ...
0
votes
3answers
59 views

Float is printf wrong value

I have another float output issue printing "1.#R", I have narrowed it down to recurring values, so my question is how do I round the value to the 2 decimal places, so I can print the value (but not ...
0
votes
2answers
46 views

Returning pointers from function gives weird numbers

Iam trying to get the max number of this array that has numbers from -20 to 30 but it returns weird numbers like this --> 2255667 which is impossible if all is going well. int * ptomx(int a[],int n) ...
0
votes
3answers
96 views

Function returning pointer to pointer

Please look at my code below: class SVMClassifier : public LibHAR { public: ... //This is my function returning a pointer to pointer to svm_node structure svm_node** ...
-2
votes
1answer
53 views

Creating realloc array in C function and sending it to another

My code: void calculations(int *data1, int *data2, int size1, int size2){ if (size1 != 0 && size2 != 0){ int *temp_data = NULL; all_in_one(&temp_data, data1, data2, *size1, ...
0
votes
5answers
56 views

Change given function parameter within the function c++

I wrote an function called swap to swap given two elements within the function. But when I use it in another function, it doesn't work. How to get it work? #include <iostream> using namespace ...
-1
votes
2answers
26 views

Why the pointer to function gets value 0x00000000?

Why proc which is a function pointer gets null value? EDITED:
0
votes
1answer
79 views

Filling array in C by using functions

Okay, so I am calling function fill_arrays like this: fill_arrays(&data1, &data2, &size1, &size2); fill_arrays looks like this: void fill_arrays(int **data1, int **data2, int ...
0
votes
4answers
67 views

How to assign anything to array in this C function?

I have this C function: fill_array(&data, &size); void fill_array(int **data, int *size){ printf("Size is:"); scanf("%d", size); *data = malloc(*size * sizeof(int *)); int i = 0; ...
1
vote
2answers
45 views

Calling functions using an array of pointers

I have the following files in my program, a header with certain function definitions, and a program with the body of the functions. something.h typedef struct _foo { int id; int lucky_number; } ...

1 2 3 4 5 38
15 30 50 per page