[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 AnswersNew Answer
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 😊
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.
My code error is solved,Thank you so much 😄 PÃŁŁÃVÎ JHÁ Thank you Coder Kitten vamsi😎 ++༒«ᵛ ⁱ ⁿ ᵃ ʸ ᵃ ᵏ»༒++ @💕PARI💕
Thank you so much Sonic
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!!!
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.
You're welcome 😇
حسوني الغيباوي You have to say something relevant to the thread.
The Algorithm is what is represented by a flowchart or pseudocode.
Ousmane Leye please use the search bar to find pre- answered questions or post your question!!
conio.h is not available on Sololearn.
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
192.168.00.000 no problem. Have a look at Coder Kitten answers.
You should use a printf("6. Exit\n");
How do we use strrev in c
ابغا اتعلم اختراق فدوه