RSS Forums RSS
Please support our C++ advertiser: Programming Forums
Views: 280 | Replies: 1
Reply
Join Date: Apr 2008
Posts: 22
Reputation: Seamus McCarthy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Seamus McCarthy Seamus McCarthy is offline Offline
Newbie Poster

int array in c++

  #1  
Apr 21st, 2008
	    const int capacity2 = 120;
	    int rows[capacity2];
		for (int i = 0; i < capacity2; i++)
		{
		if ( x == 11)
			{ rows[i] = 1;
			  break;
			} 
		else if ( x == 13)
			{ rows[i] = 2;
			  break;
			}
		else if ( x == 15)
			{ rows[i] = 3;
			  break;
			}
		else if ( x == 17)
			{ rows[i] = 4;
			  break;
			}
		}	
			cout << "row = "<< rows;  
Can't understand why the row answer isn't giving me the correct output instead if gives me rows = 0x0012fd70. Again any help would be very appreciated!!
Last edited by Seamus McCarthy : Apr 21st, 2008 at 5:45 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Posts: 22
Reputation: Seamus McCarthy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Seamus McCarthy Seamus McCarthy is offline Offline
Newbie Poster

Re: int array in c++

  #2  
Apr 21st, 2008
Sorry solved the problem myself. Justed needed rows[0] instead! my bad!!
Reply With Quote  
Reply

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

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:41 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC