473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

I am receiving abnormal program termination

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main() {
  4. char str[1]; char ch;
  5. printf("Enter the String: ");
  6. gets(str);
  7. strrev(str);
  8. printf("the reverse string is %s",str);
  9. return 0;
  10. }
  11. reverse(char *ch)
  12. {
  13. char *t, temp;
  14. t = ch;
  15.  while (*t =='')
  16. t--;
  17. t++;
  18. while (ch>t); 
  19. {
  20. temp = *ch
  21. *ch != *t;
  22. *t = temp;
  23. ch++;
  24. t--;
  25. return 0;
  26. }
  27. }
Jun 11 '20 #1
2 2179
dev7060
636 Expert 512MB
I am receiving abnormal program termination
A build is able to terminate abnormally during runtime after it is generated from the error-free code. This doesn't seem the case with the posted code.
Jun 11 '20 #2
Banfa
9,065 Expert Mod 8TB
Look at line 4, how long is the array str?
When you call gets at line 6 how many characters do you type in?

What happens if you only type 1 character?
What if you type more than 1?
What if you type lots?


gets is a dangerous function because it does not limit the number of characters entered, gets is a much better function because it does.
Jun 11 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Pote | last post by:
Running my programme in Python 2.3.4 I received the following msg in the consol :- (Pent III running W2K prof) """ Exception in Tkinter callback Traceback (most recent call last): File...
1
by: R6_2003 | last post by:
Hello all, i dunno if that's the right newsgroup to ask, but i'll try, please ignore me if u feel its not 0:) i've been messing with a control panel app for so long.. previously i was using...
3
by: Mahmood Ahmad | last post by:
Hello, I have written a program that reads three types of records, validates them acording to certain requirements and writes the valid records into a binary file. The invalid records are...
2
by: Hugh | last post by:
Hello, Apologies if this has already been answered in here and I can't find it, but can anyone help with this problem? I hope the example code and comments state clearly enough what is...
0
by: Alexander F?hrmann | last post by:
Grüß euch! Wir haben hier in der Firma ein Problem mit Access! Sobald man im Access den VBA-Editor aufrufen will, kommt folgender fehler! -------------------- Runtime Error!
16
by: PyDenis | last post by:
Today, I found strange error while using py2exe: 1. I wrote simple program and save as 1.py: import win32ui import win32con win32ui.MessageBox('Test messageBox.' , 'Test', win32con.MB_OK |...
9
by: ehabaziz2001 | last post by:
I am facing that error message with no idea WHY the reason ? "Abnormal program termination" E:\programs\c_lang\iti01\tc201\ch06\ownarr01o01 Enter a number : 25 More numbers (y/n)? y...
6
by: helpswat4 | last post by:
I was wondering if someone could help me with this problem...i get a runtime error everytime i try to play Swat 4 on my PC.It says abnormal program termination and i have no idea why....could someone...
5
by: Dnny | last post by:
hi hi microsoftc++ runtime library on picture it 2002 can you help me ppppppppppp ty vm
1
by: qzhang | last post by:
I get that error message everytime i try to play freedom force vs 3rd reich game its not that much of an older game and i'm trying to play it on my vista laptop please help
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.