|
| |||||||||
| Tags: c language, declare function, function, pointers, syntax |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Pointer parameter in a function
I know function Pointers allow to callback functions but i want to the know the syntax and the procedure to declare function and to pass char pointer into function. Any recommendations and suggestions are appreciated. |
|
#2
| ||||
| ||||
| Re: Pointer parameter in a function
Function Pointers are pointers, i.e. variables, which point to the address of a function. Function pointers are often used within subroutines in cases where one would want the subroutine to be able to work with classes of functions whose names one might not know until the program is running. When dereferenced, a function pointer invokes a function, passing it zero or more arguments just like a normal function. You must keep in mind, that a running program gets a certain space in the main-memory. |
|
#3
| |||
| |||
| Re: Pointer parameter in a function
Initializing, De-referencing a Pointer Variable : Examples: Code: int u; int k; int* pic1; int* pic2; char* pcr; pic1 = NULL; pcr = NULL; pic2 = &i; pic1 = pic2; pcr = (char*)&k; *pic2 = 6; pic2 = &j; *pic2 = 18; |
|
#4
| |||
| |||
| Re: Pointer parameter in a function
Try this example : Code: #include <stdio.h>
void print_vertical(char *strl);
int main(int arc, char *argv[])
{
if(arc > 1) print_vertical(argv[2]);
return 0;
}
void print_vertical(char *strl)
{
while(*strl)
printf("%c\n", *strl++);
} |
|
#5
| |||
| |||
| Re: Pointer parameter in a function
Thanks you:I have exactly the same problem as you. I tested in my IDE, everything works and displayed my JOptionPane.The call is contained in my classes in other Jar. But when I launch the application nothing happens except the normal opening. This is quite problematic for me, since the external jar used to validate the registration of the software license and as it does not appeal to class everything goes well without the software is not registered. And again I have only this problem with MAC. When I run under Windows or Linux or directly from my main .jar it works! __________________ Simulation rachat credit personnel reduit | Demande rachat credit personnel en ligne | Comparatif meilleur taux rachat credit pret personnel |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Pointer parameter in a function" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parameter function and generic pointer | Rubero | Software Development | 7 | 25-09-2010 10:04 PM |
| Matrix parameter function | Chrisch | Software Development | 3 | 02-12-2009 11:07 AM |
| Pointer of file in parameter | Wyvern | Software Development | 4 | 05-11-2009 11:50 PM |
| Problem in a function pointer | Rilex | Software Development | 3 | 23-05-2009 11:21 PM |
| Exercise pointer and function in C | Bull50 | Software Development | 3 | 10-04-2009 12:51 AM |