How to create an example for the complex statement? [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
There is a complex statement in my textbook:
int (*f(float (*)(long),char *))(double);
I want to create an example for illustrating how to use this statement, although I understand the meaning of the statement, it's hard for me to write the example. Can anyone help me?
P.S.: C language.

int (*f(float (*)(long),char *))(double)
f is a function that has 2 parameters of type
float (*)(long), << pointer to function long=>float
char * << string
and returns
(int)(*)(double) << a pointer to a function double=>int

Related

my project has diffrent result every time [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I wrote this code in my project but every time i run it the answer is diffrent.
]1
Initialize sum with a value of 0. The reason it is different every time is you are calling sum which you never assigned a value. Anything could be in memory where sum is stored, which is why your results are inconsistent.

For Loops in C to print out individual ints. [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to print out each integer of an int individually using a for loop. I am doing this because I want to print things in between some of the single ints. So if the number was 4564, I want to print out 4 5 6 4. Is there a quick way to do this?
I know how to do it in java but I am new to C and am not sure.
Something like this shall help
while(num!=0) {
printf("%d", num%10); //your last digit, you can store it in an array of characters as well
num = num/10 ;
}
Note : you've got to reverse the order while using the digits

Displaying an array by using pointer techniques [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to display the contents of an array with type double that has a length of 5 without using the [ ] indexing . I can only use a for loop and pointer techniques.
How can you achieve that ?
Can anyone give me a brief explanation of pointers as I have no idea how to use them exactly ?
The array indexing operator is a shorthand for hiding pointer arithmetic.
So if you have an array like this:
double a[5];
Instead of using this expression:
a[1]
You can use this:
*(a + 1)

User input to an array [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
When using C programming language, I have no idea how to put a user input to an array.
I need to get integers from the user in from of:
printf("Enter numbers. Separate each by a comma: ");
How can I put each number into an array?
This is a very helpful link
Also look up this too for clarification on Console.Read & Console.Readline
Difference between Console.Read() and Console.ReadLine()?

How do I convert an int to hexadecimal and then put it as a string format? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
For example, let's say I have the decimal number 10.
I want to be able to go form an integer of 10 to a string of "0a".
How do I do that?
Note: I don't want anything printed out.
You can use sprintf to represent a numeric value in hexadecimal format:
sprintf(buff, "%0.2x\n", 10)
Take also a look at dmckee's comment on int/hexadecimal misunderstanding.

Resources