Sponsored Content
Full Discussion: Segmentation fault
Top Forums Programming Segmentation fault Post 302858387 by sizzler786 on Monday 30th of September 2013 07:29:39 AM
Old 09-30-2013
Apologies.
The code is running for me and I do have my warnings turned on etc;
First it asks you to choose from a calculator and Binary convertor,
You either enter "1" (for calc) and "2" (for binary convertor) and press Enter.
If you choose CALC It then allows you to choose from
Addition, subtraction, multiplication, Division, and then you have to enter two digits separated by a space.Everything upto there but then it also gives me a '0' as an answer. How ever if i get rid of all of my code leaving just the addition part, it works perfectly fine.




Thankyou
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Segmentation Fault

hello all, I tried a program on an array to intialise array elements from the standard input device.it is an integer array of 5 elements.but after entering the 4th element it throws a message called "Segmentation Fault" and returns to the command prompt without asking for the 5th element. ... (3 Replies)
Discussion started by: compbug
3 Replies

2. Programming

Hi! segmentation fault

I have written a program which takes a directory as command line arguments and displays all the dir and files in it. I don't know why I have a problem with the /etc directory.It displays all the directories and files untill it reaches a sub directory called peers which is in /etc/ppp/peers.the... (4 Replies)
Discussion started by: vijlak
4 Replies

3. Programming

segmentation fault

ive written my code in C for implementation of a simple lexical analyser using singly linked list hence am making use of dynamic allocation,but when run in linux it gives a segmentation fault is it cause of the malloc function that ive made use of????any suggestions as to what i could do??? thank... (8 Replies)
Discussion started by: rockgal
8 Replies

4. AIX

Segmentation fault

Hi , During execution a backup binary i get following error "Program error 11 (Segmentation fault), saving core file in '/usr/datatools" Riyaz (2 Replies)
Discussion started by: rshaikh
2 Replies

5. Programming

Why not a segmentation fault??

Hi, Why I don't receive a segmentation fault in the following sample. int main(void) { char buff; sprintf(buff,"Hello world"); printf("%s\n",buff); } If I define a buffer of 10 elements and I'm trying to put inside it twelve elements, Should I receive a sigsev... (22 Replies)
Discussion started by: lagigliaivan
22 Replies

6. UNIX for Dummies Questions & Answers

Segmentation Fault

Hi, While comparing primary key data of two tables thr bteq script I am getting this Error. This script is a shell script. *** Error: The following error was encountered on the output file. Script.sh: 3043492 Segmentation fault(coredump) Please let me know how to get through it. ... (5 Replies)
Discussion started by: monika
5 Replies

7. Programming

segmentation fault

Hi, I am having this segmentation fault not in the following program, bt. in my lab program . My lab program is horrible long so cannot post it here bt. I am using the following logic in my program which is giving the segmentation fault. Bt. if I run this sample program as it is it dosen't give... (3 Replies)
Discussion started by: mind@work
3 Replies

8. Programming

Using gdb, ignore beginning segmentation fault until reproduce environment segmentation fault

I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this : i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
Discussion started by: pooyair
6 Replies

9. Homework & Coursework Questions

Segmentation Fault

this is a network programming code to run a rock paper scissors in a client and server. I completed it and it was working without any error. After I added the findWinner function to the server code it starts giving me segmentation fault. -the segmentation fault is fixed Current problem -Also... (3 Replies)
Discussion started by: femchi
3 Replies

10. Programming

C. To segmentation fault or not to segmentation fault, that is the question.

Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1... I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one. Below are two very condensed snippets of which I have added the results inside the each code section. IMPORTANT!... (11 Replies)
Discussion started by: wisecracker
11 Replies
QMacMime(3qt)															     QMacMime(3qt)

NAME
QMacMime - Maps open-standard MIME to Mac flavors SYNOPSIS
#include <qmime.h> Public Members QMacMime ( char t ) virtual ~QMacMime () virtual const char * convertorName () = 0 virtual int countFlavors () = 0 virtual int flavor ( int index ) = 0 virtual bool canConvert ( const char * mime, int flav ) = 0 virtual const char * mimeFor ( int flav ) = 0 virtual int flavorFor ( const char * mime ) = 0 virtual QByteArray convertToMime ( QValueList<QByteArray> data, const char * mime, int flav ) = 0 virtual QValueList<QByteArray> convertFromMime ( QByteArray data, const char * mime, int flav ) = 0 Static Public Members QPtrList<QMacMime> all ( QMacMimeType t ) QMacMime * convertor ( QMacMimeType t, const char * mime, int flav ) const char * flavorToMime ( QMacMimeType t, int flav ) DESCRIPTION
The QMacMime class maps open-standard MIME to Mac flavors. Qt's drag-and-drop and clipboard facilities use the MIME standard. On X11, this maps trivially to the Xdnd protocol, but on Mac although some applications use MIME types to describe clipboard formats, others use arbitrary non-standardized naming conventions, or unnamed built- in Mac formats. By instantiating subclasses of QMacMime that provide conversions between Mac flavors and MIME formats, you can convert proprietary clipboard formats to MIME formats. Qt has predefined support for the following Mac flavors: kScrapFlavorTypeUnicode - converted to "text/plain;charset=ISO-10646-UCS-2" and supported by QTextDrag. kScrapFlavorTypeText - converted to "text/plain;charset=system" or "text/plain" and supported by QTextDrag. kScrapFlavorTypePicture - converted to "image/format", where format is a Qt image format, and supported by QImageDrag. kDragFlavorTypeHFS - converted to "text/uri-list", and supported by QUriDrag. You can check if a MIME type is convertible using canConvert() and can perform conversions with convertToMime() and convertFromMime(). See also Drag And Drop Classes, Input/Output and Networking, and Miscellaneous Classes. MEMBER FUNCTION DOCUMENTATION
QMacMime::QMacMime ( char t ) Constructs a new conversion object of type t, adding it to the globally accessed list of available convertors. QMacMime::~QMacMime () [virtual] Destroys a conversion object, removing it from the global list of available convertors. QPtrList<;QMacMime> QMacMime::all ( QMacMimeType t ) [static] Returns a list of all currently defined QMacMime objects of type t. bool QMacMime::canConvert ( const char * mime, int flav ) [pure virtual] Returns TRUE if the convertor can convert (both ways) between mime and flav; otherwise returns FALSE. All subclasses must reimplement this pure virtual function. QValueList<;QByteArray> QMacMime::convertFromMime ( QByteArray data, const char * mime, int flav ) [pure virtual] Returns data converted from MIME type mime to Mac flavor flav. Note that Mac flavors must all be self-terminating. The return value may contain trailing data. All subclasses must reimplement this pure virtual function. QByteArray QMacMime::convertToMime ( QValueList<QByteArray> data, const char * mime, int flav ) [pure virtual] Returns data converted from Mac flavor flav to MIME type mime. Note that Mac flavors must all be self-terminating. The input data may contain trailing data. All subclasses must reimplement this pure virtual function. QMacMime * QMacMime::convertor ( QMacMimeType t, const char * mime, int flav ) [static] Returns the most-recently created QMacMime of type t that can convert between the mime and flav formats. Returns 0 if no such convertor exists. const char * QMacMime::convertorName () [pure virtual] Returns a name for the convertor. All subclasses must reimplement this pure virtual function. int QMacMime::countFlavors () [pure virtual] Returns the number of Mac flavors supported by this convertor. All subclasses must reimplement this pure virtual function. int QMacMime::flavor ( int index ) [pure virtual] Returns the Mac flavor supported by this convertor that is ordinarily at position index. This means that flavor(0) returns the first Mac flavor supported, and flavor(countFlavors()-1) returns the last. If index is out of range the return value is undefined. All subclasses must reimplement this pure virtual function. int QMacMime::flavorFor ( const char * mime ) [pure virtual] Returns the Mac flavor used for MIME type mime, or 0 if this convertor does not support mime. All subclasses must reimplement this pure virtual function. const char * QMacMime::flavorToMime ( QMacMimeType t, int flav ) [static] Returns a MIME type of type t for flav, or 0 if none exists. const char * QMacMime::mimeFor ( int flav ) [pure virtual] Returns the MIME type used for Mac flavor flav, or 0 if this convertor does not support flav. All subclasses must reimplement this pure virtual function. SEE ALSO
http://doc.trolltech.com/qmacmime.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qmacmime.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QMacMime(3qt)
All times are GMT -4. The time now is 08:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy