User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 423,353 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,153 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 793 | Replies: 31 | Solved
Reply
Join Date: Jul 2005
Posts: 1,138
Reputation: Lerner is just really nice Lerner is just really nice Lerner is just really nice Lerner is just really nice 
Rep Power: 9
Solved Threads: 149
Lerner Lerner is offline Offline
Veteran Poster

Re: PLZ RESPOND...Very very important

  #31  
Jul 8th, 2008
>The problem actually is i dont get the corect no of spolit ballots...i get it as 4325678>


between line 10 where you declare the variable called invalid and line 26 where you increment the variable called invalid by one you never initialize/assign the variable called invalid to any given value, so it's junk. In you increment junk by one you still get junk. When you display the variable called invalid you will display junk. To correct this problem you need need initialize/assign the variable called invalid to some valid value before you try to increment/output it or use it in some other way (the same goes for all other variables you will ever use as well so learn the lesson well or you are doomed to repeat it indefinitely). In this case you probably want to initialize/assign the value called invalid to zero some place between line 10 and line 26, say maybe make line 11 look like this:

invalid = 0;
Last edited by Lerner : Jul 8th, 2008 at 10:06 am.
Reply With Quote  
Join Date: Jul 2008
Posts: 46
Reputation: anuizath2007 has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 0
anuizath2007 anuizath2007 is offline Offline
Light Poster

Re: PLZ RESPOND...Very very important

  #32  
Jul 8th, 2008
thanks alot..i could nt have done it without your help...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 12:02 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC