Campbell Ritchie wrote:Welcome to the Ranch
We don't give out complete solutions, but please show us what you have achieved so far and we shall try to help you improve it.
Campbell Ritchie wrote:Please post the code here, using the code button and picking C++ from the dropdown list just to the right of the code button. Many people are reluctant to open such third party links.
No.Smith Kelly wrote:. . . Can you look again ? . . .
Campbell Ritchie wrote:
No.Smith Kelly wrote:. . . Can you look again ? . . .
That code is illegible because of poor formatting.
Apology accepted . . . butSmith Kelly wrote:. . . Sorry . . .
I am afraid, no. At least I can see where the individual functions start, but I can't see the structure of each function. Don't double‑space your code. Leave blank lines (probably only one empty line) between successive functions and after your #includes or typedefs. After each { move one indent's level to the right, and each } is one indent left of what preceded it. Maybe getting a decent text editor (for Windows® I like NotePad++) and setting its automatic indentation option and conversion of 1 tab → 4 spaces will make it easier for you. You will have no end of difficulty finding errors in your code if you format it badly.
Is it okay now ? . . .
Campbell Ritchie wrote:
It more a case of, if you don't make the effort to provide code in a form suitable for people to help you, you won't get any help.Smith Kelly wrote:. . . If you dont want to help to me You should say it. . . .
Smith Kelly wrote:I spent a lot of effort but you don't want to help.
Campbell Ritchie wrote:Is there something like fprintf(), which will allow you to print everything into the file in one instruction?
Programming in other languages is just as difficult.Smith Kelly wrote:. . . C programming is very hard to learn.
I don't see anything there, apart from 'error3' which isn't very helpfulSmith Kelly wrote:I couldnt use Img button
https://hizliresim.com/DHyVXN
Please don't. Many people are reluctant to open unidentified links like that. Please copy'n'paste the text from your terminal window or IDE. Those error messages all look pretty straightforward.Smith Kelly wrote:. . . I couldnt use Img button . . .
It's C++, in which you don't need to use typedefs for structs. But as you point out, the question did say use typedef, and in fact the OP asked:Campbell Ritchie wrote:What does line 6 mean? You were told to use typedef; why didn't you write typedef?
To the OP - does it need to be in C? If so, you need to remove/change the few bits of C++-specific code.How to write these [programs] in C programming language ?
Yes, and however bad my C is, my C++ is so much worse I wouldn't have gone near this question otherwise.John Matthews wrote:. . . in fact the OP asked:
. . .How to write these [programs] in C programming language ?
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|