C++ problem. Zero showing as " -858993460"
|
|
EEYORE
|
Wed Apr 07 2010, 06:19AM
|
|
|
Registered Member #99
Joined: Thu Feb 09 2006, 06:10PM
Location: florida, usa
Posts: 637
|
Hello all, I am working on a class project for C++ and when I am attempting to get my program to show the contents of an array (which is zero) it is showing up as -858993460 instead of zero. For example, I have an array, say A[6]. In A[2] there should be a zero. When I call : cout<<A[2]<<endl; I get -858993460 instead of zero. The rest of the array elements show their values just fine and math also works out. (C++ treats it as a zero). My teacher will ring my neck to have -858993460 output as part of my data output.
I suck at programming! Help? Thanks, Matt
EDIT: Got it working. I forgot to initialize....Sigh...
|
Back to top
|
|
Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob
|
|
Powered by e107 Forum System
|