[ERROR SOLVED] C PROGRAM | SoloLearn: Learn to code for FREE!

+21

[ERROR SOLVED] C PROGRAM

1.https://code.sololearn.com/cbkI08XOydpS/?ref=app showing error in line 29. 2.[REASON]Why we use fgets instead of gets in sololearn. when i write gets its showing me an error. 3.[REASON] void main()/main() not works in sololearn.int main() works. 4.[REASON] if i include <conio.h> it showing me output that compilation terminated. 5.[SUGGESTION] Which is easy to understand and write program.[FLOWCHART,ALGORITHM,PSEUDO CODE]. Edit :- my real intention was to solving error of the code,that solved.which solve by pallavi jha...

10/19/2020 11:01:07 AM

ᕙ(@°▽°@)ᕗ

17 Answers

New Answer

+7

https://code.sololearn.com/ci9C5QRb5596/?ref=app In this i made some changes. In sololearn we can't use some string.h functions so u need to make a proper well defined function for every different work for example reversing the string, concatenation etc. And i want to suggest that use algorithms to write and understand codes. I hope this will helpful for u 😊

+12

1. strrev is not StdC, hence may not be (in this case it is not) available 2. gets has been deprecated for ages, now removed. Reason: gets introduce buffer overflow vulnerabilities, hence dangerous. 3. As per the standard, it has always been int main(...), never void main(...). void main is used in embedded C or Turbo C. 4. conio.h is a Turbo C specific library header and not available anywhere else. About 3 and 4) Turbo C is a dinosaur, and just as them it is extinct. Some colleges in the world, it appears, like jurassic park and use Turbo C - advice: keep your hands off it, be modern! 5. I use all, depending on which suits me best in any given situation. No general advice can be given other than to learn to use any one technique.

+6

My code error is solved,Thank you so much 😄 PÃŁŁÃVÎ JHÁ Thank you Coder Kitten vamsi😎 ++༒«ᵛ ⁱ ⁿ ᵃ ʸ ᵃ ᵏ»༒++ @💕PARI💕

+6

Thank you so much Sonic

+4

https://code.sololearn.com/cvirlrYg52Zz/?ref=app I happened to find this. 😐And I do agree with Coder Kitten . Void main can be used, but it just doesn't return anything. Gets, as explained, induces buffer overflow, and is not used for string operations (basically not used at all!!) Donno much about the rest, but thanks man!! Learnt many cool things today!!!

+4

The reason why Turbo C uses void main() is, I believe, because it executes the program within its own environment using an internal console which is controlled via the conio header (providing things like clrscr and gotoxy and such and such). At least that is how Turbo Pascal worked when I started out in the mid 1980ies. Within that environment, the program is not meant to return anything. Using void main() then seems only logical.

+4

You're welcome 😇

+4

حسوني الغيباوي You have to say something relevant to the thread.

+3

The Algorithm is what is represented by a flowchart or pseudocode.

+3

Ousmane Leye please use the search bar to find pre- answered questions or post your question!!

+3

conio.h is not available on Sololearn.

+3

Apparently strrev() is not part of the C standard and not available to gcc on Linux for example. https://www.sololearn.com/post/688108/?ref=app

+3

192.168.00.000 no problem. Have a look at Coder Kitten answers.

+2

You should use a printf("6. Exit\n");

+1

How do we use strrev in c

0

ابغا اتعلم اختراق فدوه