Results 1 to 10 of 10

Thread: Converting a numerical char array to a long?

Threaded View

  1. #7
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    no

    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
    	int myarray[3];
    	myarray[0] = 1;
    	myarray[1] = 2;
    	myarray[2] = 3;
    	myarray[3] = 4;
    
    	cout << myarray[0] << myarray[1] << myarray[2] << myarray[3] << endl;
    }
    This will output 1234

    myarray[3] holds 4 elements.

    I would also like to recommend the use of vectors, arrays suck compared to vectors
    Last edited by Kasracer; Aug 16th, 2003 at 09:46 PM.

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