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

conditional jump or move depends on uninitialised value(s)

29
I am using valgrind leak memory to check my program this message appears a lot of time, the program works but why this message.
example code
Expand|Select|Wrap|Line Numbers
  1. double RandNum,pp;  
  2.     double axis=AXIS;
  3.     double wise_profit=0.20;
  4.     double mu, delta,a,b;
  5.     double sattisfic_price;
  6.   RandNum=Rand.getRandomFloat();
  7.  
  8.     if(prod_size<=prod_sold && prod_sold>0) SetPrice(GetPrice()+axis*RandNum); 
  9.     else if(prod_size>prod_sold && prod_sold>0)
  10.     {
  11.         mu=wise_profit*interestrate*satisfic_wage*numworkers;
  12.         delta=prod_size*prod_size*(1-mu/(interestrate*satisfic_wage*numworkers));
  13.         a=(-prod_size*prod_size)/(4*interestrate*satisfic_wage*numworkers);
  14.         b=prod_size;
  15.         sattisfic_price=(-b-sqrt(delta))/(2*a); <<-------- Here is the error
  16.         SetPrice(sattisfic_price);
  17.     }  
  18.  
  19.  
Jan 24 '08 #1
1 4481
The problem cannot be deduced from the given sample code. It is likely that the reported error indicates your given problem - that is, you are calling a subroutine or have placed a call to a subroutine (etc.) based on a variable of which the value you have not set.

In computing, an uninitialized variable is a variable that is declared but is not set to a definite known value before it is used. It will have some value, but not a predictable one. As such it is a programming error and a common source of bugs in software.
Feb 26 '08 #2

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

Similar topics

0
by: Andrew L | last post by:
Hello all, I'm new to XML schema design, and I've got a problem which I need some help with. I have a simple type which describes a list of valid categories. I also have another type which...
13
by: santosh | last post by:
Hi, If I call free() with a uninitialised pointer, will the program state become undefined, or will free() return harmlessly? Incidentally, is there a way in Standard C to determine weather a...
43
by: dev_cool | last post by:
Hello friends, I'm a beginner in C programming. One of my friends asked me to write a program in C.The purpose of the program is print 1 to n without any conditional statement, loop or jump. ...
10
by: Lyn | last post by:
Hi, I would like to make a bound text box not visible if it is empty (not just disable it). This option is not available from the standard conditional formatting feature (at least, not that I can...
19
by: Ulrich Eckhardt | last post by:
Greetings! I was recently surprised by the compiler's warning concerning this code: struct text { char* s; size_t len; }; int main() { struct text t = {"hello world!"};
13
by: Neal Becker | last post by:
In hindsight, I am disappointed with the choice of conditional syntax. I know it's too late to change. The problem is y = some thing or other if x else something_else When scanning this my...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.