Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem in running C program in linux

Status
Not open for further replies.

smartshashi

Member level 4
Joined
Aug 11, 2004
Messages
68
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
513
Dear all

I am facing problem with some C program which are running correctly in turbo C, but are giving problems in linux. Though logic is correct it is giving me segmentation fault. please help out how to resolve this problem.

if any one have some links which will help [/b]me plz send them as early as possible.
 

you make me smile, I faced the same problem for such a long time
Segmentation fault occurs when you try to access memory that you are not allowed to access,
I works in Turbo C because inside windows turbo C works in an emulated Virtual Machine.
If you try to run it under Win32 e.g on Visual C++ you will get the same error, called access voilation.

to correct this , allocate the memory before you access it

dont do

char * name;
name="abc";

just do it like

char * name;
name=alloc(10);
name="mehboob";

this should work all right.
 

try to use bloodshed. this is a better software for linux as well as windows for C++. use and let me know how did u like
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top