Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

This is not only true of perl and Java. In my C++ class I learned many, easily 20+ lines of code, difficult ways to create unlimited arrays. Once I looked at the standard headers included with C++, this was 4 years ago, I noticed vector.

#include <vector> #include <iostream> std::vector<char> array; char c = 0; while(c != 'X' || c != 'x') { //enter something or exit to quit std::cin>>c; array.push_back(c); //remind you of anything ;) } std::cout<<array.size()<<std::endl; /* btw., the way I learned to get an arrays length was to create a sec +ond int array as a counter*/

As for why the One Way, or more approapriately Best Way is ignored, that's a good question

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce


In reply to Re: There's Only One Way To Do It by kutsu
in thread There's Only One Way To Do It by jdporter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found