array question?

This is a discussion on array question? within the C++ Programming forums, part of the General Programming Boards category; Greetings, Can anyone help me? I am to show the values of all the array elements. And make sure the ...

  1. #1
    TransparentMember correlcj's Avatar
    Join Date
    Jun 2002
    Posts
    378

    array question?

    Greetings,
    Can anyone help me? I am to show the values of all the array elements. And make sure the output is a string of numbers with no spaces. I believe my code is correct but need help understanding if I am missing ALL oif the array elements

    Code:
    #include <iostream>	//cin, cout, <<, >>.
    #include <string>	// use for string variables.
    
    using namespace std;
    
    const int LITTLE = 6,	//Word LITTLE eqauls 6.
    		  MEDIUM = 10,	//Word MEDIUM eqauls 10.
    		  BIG = 128;	//Word BIG eqauls 128.
    
    int i, j, n = 9,	//integers and n inilized to number 9.
    	temp, 
    	number[MEDIUM] = { 99, 33, 44, 88, 22, 11, 55, 66, 77};	//an array.
    		
    char ch,	//characters.
    	letterCount[BIG];	//an array.
    
    typedef double LittleDouble[LITTLE];	//redefines array LITTLE to LittleDouble.
    
    LittleDouble value;
    
    int main() 
    {
    	for (i = 1; i < LITTLE; i += 2)	//a loop, i = 1, i < 6, increase i by 2.
    	{
    		value[i - 1] = double(i) / 2.0;
    		value[i] = 10.0 * value[i - 1];
    			cout << "this is array value["<< i <<"] = "<< value[i] << '\n';
    	}
    	return 0;
    }
    cj
    Last edited by correlcj; 11-08-2002 at 06:11 PM.
    "Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
    -Bruce Lee

  2. #2
    TransparentMember correlcj's Avatar
    Join Date
    Jun 2002
    Posts
    378

    Got it!

    Whomever responds, I want to say thanks anyway.
    cj
    "Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
    -Bruce Lee

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. question about multidimensional arrays
    By richdb in forum C Programming
    Replies: 22
    Last Post: 02-26-2006, 09:51 AM
  2. Dynamic Mutli dimensional Array question.
    By fatdunky in forum C Programming
    Replies: 6
    Last Post: 02-22-2006, 07:07 PM
  3. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 05:15 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  5. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 08:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21