problem with g++ on cygwin

community help helpcomm@yahoo.com
Thu Oct 20 13:07:00 GMT 2005


Hi,

I'm using g++ on cygwin for developping some c++
programs.

I noticed that everytime i manipulate pointers i have
an error saying:
"Segmentation Fault <Core Dumped>".

An other file is added to the working directory. If i
compile with the following:
g++ -o file_name file_name.cc
i have a file_name.exe but also a
file_name.exe.stackdump.

i wrote a very simple example for testing:
----------------------
#include <iostream.h>
#include <string.h>

int main()
{
	char * str;
	str = "hello";
	*(str+1) = 'a';
	return 0;
}
---------------------
This simple example also gave me the same error.

I hope somebody can help me with this.

Thank you


		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list