Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Bus Error!?

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  What do You like best with Your Mac?  
Author Message
Daniel.J.Wilson

External


Since: Nov 08, 2005
Posts: 1



(Msg. 1) Posted: Tue Nov 08, 2005 1:35 pm
Post subject: Bus Error!?
Archived from groups: comp>sys>mac>programmer>help (more info?)

Hello -

I have started coding C since September and am trying to compile a
program which works as a very rudimentary code breaker (utilizing
english language letter frequencies).

I have managed to find the letter frequencies of a document and sort
them - but was trying to find a way to read the input (which was
originally stdin from the keyboard) a second time in order to replace
the original letters with new letters.

It was suggested that I read from a second file in the same directory
using fopen and fgetc to read it - but when i try that I am getting a
bus error. Yet it seems to work when compiled on a windows system.
What might I be doing wrong? I can send the code if that is helpful.

Thanks -
Daniel

 >> Stay informed about: Bus Error!? 
Back to top
Login to vote
vze35xda

External


Since: Jan 08, 2005
Posts: 85



(Msg. 2) Posted: Tue Nov 08, 2005 2:39 pm
Post subject: Re: Bus Error!? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Very difficult to tell without looking at the code. But when you read
in the data make sure you are not reading in more data than you have
space for. That is if you have a buffer of 10 and read in 11
characters bad stuff happens. Are you working on this in XCode ? If so
in the debugger when this happens the debugger will halt and show you
the program stack at the failure. At the top will be functions in the
C library or system that will dump in ASM code, lower down will be
stuff you wrote. It will show you the line where you have an error.
You can then poke around to see what might be happening.
--jim

 >> Stay informed about: Bus Error!? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Error -35? - Is there a comprehensive list of error codes? I'm looking for error -35, -43, and 5000, and what could possibly cause them...does anyone have any ideas? A lot of people are getting an error -35 when they try to open our application. Thanks, Mike

Error 952? - Does anyone know what error 952 is? I can't seem to find it in MacErrors or anywhere else... Thanks, Alex

ld error - Hi, I would build a little unix application on macosx, but I become a little error message. gcc video.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc audio.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc wrapper.c -...

ld error - Hi, I Have a link error : ld: common symbols not allowed with MH_DYLI output format with the -multi_module option /usr/local/mysql/lib/libmysqlclient.a(charset.o) definition of common _all_charsets (size 1024) My program uses mysql and mysql++ I have...

obj-c++ error - I'm trying to compile the code below and I'm getting the following error. PatternWrapper.mm:57: error: request for member 'str_pattern' in 'self- >PatternWrapper::pattern', which is of non-class type 'NS::Pattern*' Here's what I'm trying to compile ...
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]