473,385 Members | 1,292 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,385 software developers and data experts.

does anyone know what this means?

11
Program received signal SIGSEGV, Segmentation fault.
0x0000000000402580 in writeBit (f=0x0, b=0) at binary1.cpp:26
26 putc(b + '0', f->file);

Information:

writeBit function is as follows:

/***********************************************
* writeBit *
***********************************************
* Write bit b into open file f. b must be *
* 0 or 1. *
***********************************************/

void writeBit(BFILE* f, int b)
{
putc(b + '0', f->file);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////

I only use writeBit 3 times.

HERE

//writeCode(f, str) writes string str to BFILE* f, one bit
//at a time.
void writeCode(BFILE* f, string str)
{
int y = str.length();
for(int x = 0; x < y; x++)
{
writeBit(f, str[x]-'0');
}

}

AND HERE
void writeTree(BFILE* f, Node* t)
{
if(t->kind!=leaf)
{
writeBit(f, 0);
writeTree(f, t->left);
writeTree(f, t->right);
}
else
{
writeBit(f, 1);
writeByte(f, t->ch);
}


}
Dec 11 '09 #1
1 1827
Banfa
9,065 Expert Mod 8TB
SIGSEGV is a segmentation fault or memory access error. Often caused by either an invalid pointer operation, dereferencing a NULL or invalid pointer or an array out of bounds error, using a subscript outside the defined limits of the array.

In this case I would guess that your BFILE* f pointer is invalid or NULL. Since that pointer is passed into the 2 functions you posted that call writeBit you have probably not posted the code with the error in it.
Dec 11 '09 #2

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

Similar topics

162
by: Isaac Grover | last post by:
Hi everyone, Just out of curiosity I recently pointed one of my hand-typed pages at the W3 Validator, and my hand-typed code was just ripped to shreds. Then I pointed some major sites...
7
by: Kilian A. Foth | last post by:
I just found this amazing video puzzle game written with the pygame library, which promises to be infinite fun - but I can't get it to decode any video file I own, except the game's own example...
3
by: ArtPedUK | last post by:
I'm new on C# and I would like to know what it means and if it is necessary. decimal balances = new decimal; decimal ttl = 0m; What does 0m, means is necessary for the programman that "m",...
1
by: news.microsoft.com | last post by:
Hi, I've just finished developing an web site locally (ASP 1.1) which works fine. Now that I have posted it to our server (which has 1.0 and 1.1 installed) I get the following error message when...
29
by: Vol | last post by:
I think 'atan' can get the angle but it is not the four quadrant angle. Is there any function that i can get the angle from -pi to pi? or I have to use some if ... else? I know in Matlab, we use...
25
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does parseInt('09') give an error? ----------------------------------------------------------------------- ...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
25
by: tooru honda | last post by:
Hi, I have read the source code of the built-in random module, random.py. After also reading Wiki article on Knuth Shuffle algorithm, I wonder if the shuffle method implemented in random.py...
4
by: Lightmage | last post by:
Hello all, I am using C++ to convert a certain file into an XML file. During the conversion the program does some arithmetic operations on the information that is then outputted in xml format. ...
2
by: mvsmsh | last post by:
Hi , sysproc.snapshot_tbreorg result shows me REORG_STATUS as '4' Does anyone know what does it means ? Regards Myoungsoo
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.