A question about C program in Linux and Windows

C

Chang

I wrote a C program only for calculation
using MS visual studio and run it in Windows.
With small size of variables, it runs o.k.
with large size of variables, however, it stop abnormally.

I guess it might come from memory leakage.
So, I check it out pretty throughly but I could not
find any memory allocation and free type problem.

so, I run it in Linux and it works fine with large size of variables
which are big enough to run for a day.

I understand C programs run same way in windows and Linux.
I am confused what make it happen.
Here is my questions,

Q1) What mistake might I make?
Q2) How come it doesn't have amy problem with Linux?
Q3) If it is still memory leakage problems, what is easier way
to detect them?
Q4) Is there any thing I need to consider to run C program in
different OS?

If you have any simliar experience, Please, give me some clue or
help?

Have a nice day.
And Thanks for your time.

Chang
 
J

Jaspreet

Chang said:
I wrote a C program only for calculation
using MS visual studio and run it in Windows.
With small size of variables, it runs o.k.
with large size of variables, however, it stop abnormally.
[snip..]
Chang

If the program is a small program then please paste the code here so
that we can tell you the possible reasons for the strange behavior.
 
J

Jack Klein

I wrote a C program only for calculation
using MS visual studio and run it in Windows.
With small size of variables, it runs o.k.
with large size of variables, however, it stop abnormally.

I guess it might come from memory leakage.
So, I check it out pretty throughly but I could not
find any memory allocation and free type problem.

so, I run it in Linux and it works fine with large size of variables
which are big enough to run for a day.

I understand C programs run same way in windows and Linux.
I am confused what make it happen.
Here is my questions,

Q1) What mistake might I make?

There is a missing semicolon on line 42.
Q2) How come it doesn't have amy problem with Linux?
Q3) If it is still memory leakage problems, what is easier way
to detect them?
Q4) Is there any thing I need to consider to run C program in
different OS?

If you have any simliar experience, Please, give me some clue or
help?

Have a nice day.
And Thanks for your time.

Chang

I'm afraid that my crystal ball is out being cleaned and pressed.

If you are looking at your code and cannot see what is wrong with it,
how do you expect someone else to figure it out when we can't even see
the code?

You haven't even told us what "stops abnormally" means.
 
T

Tim Prince

Jaspreet said:
Chang said:
I wrote a C program only for calculation
using MS visual studio and run it in Windows.
With small size of variables, it runs o.k.
with large size of variables, however, it stop abnormally.

[snip..]

Chang


If the program is a small program then please paste the code here so
that we can tell you the possible reasons for the strange behavior.
We may need, in addition, the <float.h> from each system to get clues,
without venturing into "off topic" but relevant questions, such as
whether you chose to generate x87 code on linux and sse on Windows (or
didn't think about consequences of inconsistent defaults).
 
E

Emmanuel Delahaye

Chang wrote on 17/09/05 :
Q1) What mistake might I make?
Q2) How come it doesn't have amy problem with Linux?
Q3) If it is still memory leakage problems, what is easier way
to detect them?
Q4) Is there any thing I need to consider to run C program in
different OS?

My mind reader device being under repair, please post your code...

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"It's specified. But anyone who writes code like that should be
transmogrified into earthworms and fed to ducks." -- Chris Dollin CLC
 
M

Martin Ambuhl

Chang said:
I wrote a C program only for calculation
using MS visual studio and run it in Windows.
With small size of variables, it runs o.k.
with large size of variables, however, it stop abnormally.

I guess it might come from memory leakage.
So, I check it out pretty throughly but I could not
find any memory allocation and free type problem.

With the information you have provided, I have meditated on your
problem. This is the best I can come up with:

$oracle -m -w1 -w2 -nc
- -
- -
---
- -
---
---
[Mawandui Text (Shaughnessy)]
29. Guimei "Returning Maiden"
Returning maiden.
To be upright is inauspicious;
there is no place beneficial.

[WangBi Text (Baynes/Wilhelm)]
54. Guimei "The Marrying Maiden"
(Dui/The Joyous/Lake Below, Zhen/The Arousing/Thunder Above)
The Marrying Maiden.
Undertakings bring misfortune.
Nothing that would further.

[WangBi Text (Lynn)]
54. Guimei "Marrying Maid"
(Dui/Lake Below, Zhen/Thunder Above)
The Marrying Maiden is such that
to set forth would mean misfortune.
There is nothing at all fitting here.

There are no transforming lines today.
$
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top