473,385 Members | 1,326 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.

Run-Time Check Failure

momotaro
357 100+
this is the error message that i kep having:
Run-Time Check Failure #3 - The variable 's' is being used without being initialized.

and this is the part of the code concerned:
Expand|Select|Wrap|Line Numbers
  1. void ConvertToPostFix(char *exp)
  2.  
  3. {
  4.  
  5. int i;
  6.  
  7. stack *s;
  8.  
  9. for(i = 0; i != '\n'; i++)
  10.  
  11. {
  12.  
  13. if(isalnum(exp[i]))
  14.  
  15. printf("%c", exp[i]);
  16.  
  17. else if(i == 0 && !(isalnum(exp[i])))
  18.  
  19. ERROR("WRONG INPUT!");
  20.  
  21. else
  22.  
  23. Push(exp[i], s);
  24.  
  25. }
  26.  
  27. }
  28.  
  29.  
Oct 28 '07 #1
2 3059
JosAH
11,448 Expert 8TB
this is the error message that i kep having:
Run-Time Check Failure #3 - The variable 's' is being used without being initialized.

and this is the part of the code concerned:
Expand|Select|Wrap|Line Numbers
  1. void ConvertToPostFix(char *exp)
  2.  
  3. {
  4.  
  5. int i;
  6.  
  7. stack *s;
  8.  
  9. for(i = 0; i != '\n'; i++)
  10.  
  11. {
  12.  
  13. if(isalnum(exp[i]))
  14.  
  15. printf("%c", exp[i]);
  16.  
  17. else if(i == 0 && !(isalnum(exp[i])))
  18.  
  19. ERROR("WRONG INPUT!");
  20.  
  21. else
  22.  
  23. Push(exp[i], s);
  24.  
  25. }
  26.  
  27. }
  28.  
  29.  
Just read the diagnostic message. Did you initialize variable 's'? I can't see it
anywhere.

kind regards,

Jos
Oct 28 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
You are using Visual Studio.NET. When you call the push function with s as an argument the compiler needs to make a copy of it. It sees that the variable has never been initialized so it knows the copy is garbage, hence the warning.

You have to initialize s before using s.
Oct 28 '07 #3

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

Similar topics

4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
4
by: Primo | last post by:
Hi, This problem has been frustrating me for days and I hope you experts can help me out. I am trying to run a command, which I would normally run from the command line, from within my C#...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
3
by: emman_54 | last post by:
Hi every one, I am trying to run a batch file using my asp.net application. I am using the Process class to run the batch file. When I run my web application, In the task manager, i could see...
19
by: Bryan | last post by:
How can i run a bit of code straight from the IDE? Right now i make a temporary button and put the code behind that, then i run debug mode and click on the button. Is there a way to highlight...
9
by: Brett Wesoloski | last post by:
I am new to VS2005. I changed my program.cs file to be a different form I am working on. But when I go to run the application it still brings up the form that was originally declared as new. ...
7
by: Lee Crabtree | last post by:
I remember when I was first getting into .NET Forms programming that there was a rather emphatic rule about not constructing a form before calling Application.Run with it. So this: ...
8
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? --...
3
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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.