[Solved] My program is executing as expected but in the end I am an extra line called a segmentation fault near the output. Could someone see to it?
You’ve tagged this as c++ but it seems like you’re using entirely c.. So I’ll answer this as if it’s c. A segmentation fault occurs when you access memory that you don’t own. In this case you’re trying to print a character outside of the bounds of your string. (e.g. your string is len characters … Read more