function

Write the definition of a function named panic . The function prints the message "unrecoverable error" and then terminates execution of the program , indicating failure..
Hey. Sorry for the report I thought you were someone else spamming the forum in this beautiful night. You have a very simple task at hand. And it looks like you dont know what a function is?

https://www.youtube.com/playlist?list=PLAE85DE8440AA6B83

https://www.youtube.com/playlist?list=PL2DD6A625AD033D36

There are videos of what functions are in these playlists.

You just have to write a print statement that says just that, and have the function return -1 I think. Goodluck.
You can use the "exit" function that exits the program, which only takes one argument.

So if you're already familiar with how to create functions, just use this within your panic function:

exit(EXIT_FAILURE);
Topic archived. No new replies allowed.