CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15

Threaded View

  1. #7
    Join Date
    Mar 2008
    Posts
    30

    Re: How to ctreate an array of objects that contain character strings

    Code:
    char array[5][80];
    /*Declares an array that has 5 elements.
    Each of the element has 80 elements.
    The first dimension represents the 5 words and the second dimension represents the maximum length of each words.*/
    
    for(int i=0; i<5; i++)
    {
         std::cout << array[i] << "\t";
    }//Prints the 5 words.
    You can also use the string class. To use it, include string to your cpp file
    Last edited by richard_tominez; April 5th, 2009 at 06:52 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured