Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IM HAVING AN ISSUE WITH BUFFER OVERFLOW USING ECLIPSE C++ INTERFACE ,,, here is the code to get user input and reverse the string but

IM HAVING AN ISSUE WITH BUFFER OVERFLOW USING ECLIPSE C++ INTERFACE ,,, here is the code to get user input and reverse the string but if i enter more than 14 characters I have an issue with my program.. any help appreciated

/* * ReversedStrings.cpp * * Created on: Sep 25, 2018 * Author: malek */

#include #include using namespace std; int main(void) { char str[15], temp, cSel; int i, j; do {

cout << "Enter a string : "; cin.getline(str,14);

j = strlen(str) - 1; for (i = 0; i < j; i++,j--) { temp = str[i]; str[i] = str[j]; str[j] = temp; } cout << " Reverse string : " << str << endl; cout <<" "; cout <<"Would you like to enter another String? Enter Y to Continue or press X to exit."<>cSel; switch (cSel) { case 'Y':cout <<"You selected to enter another string"<

} while (cSel != 'X');

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

What is an interface? What keyword is used to define one?

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago