Search:

Type: Posts; User: mousey

Search: Search took 0.01 seconds.

  1. Thread: Need help

    by mousey
    Replies
    7
    Views
    937

    And for the alignment: cout

    And for the alignment:
    cout << setf(ios::right, ios::adjustfield) << setw(n);
    Should do it.
  2. Replies
    3
    Views
    1,570

    Thanks for the quick reply - just one more: ...

    Thanks for the quick reply - just one more:

    strcat(line, from[pos]); gives the error 'Could not find a match for strcat(char, const char)'.

    I included <cstring>.
  3. Replies
    3
    Views
    1,570

    More problems with C style strings

    I'm writing a small function to retrieve the first line from a C style string passed (I have my own reasons). Here's the code so far, in essence:
    char* getaline(char const* const from, char* to) {
    ...
  4. Thread: Help!!!

    by mousey
    Replies
    13
    Views
    1,810

    Well, for the triangle one, I would use recursion...

    Well, for the triangle one, I would use recursion (a function calling itself). Create a traingle() function, probably one that takes the height as an argument, and calculate and output the number of...
  5. Replies
    5
    Views
    3,176

    I like to think of the postfix version as a sort...

    I like to think of the postfix version as a sort of sidenote. eg...

    y = x++;

    ...would be "Y equals x. Oh, and increment x.", whereas

    y = ++x;

    ...would be "Y equals x incremented".
  6. Replies
    4
    Views
    4,598

    istream::getline()

    I'm going by a fairly old book here (I'm not particulary bothered, it's a great book), so that might be my problem, but does istream::getline() still exist? My compiler gives me an error when I tell...
  7. Replies
    10
    Views
    1,213

    Thanks, that's really useful :)

    Thanks, that's really useful :)
  8. Replies
    10
    Views
    1,213

    Lol, I guess you could say I'm a newbie C++...

    Lol, I guess you could say I'm a newbie C++ programmer, but I'm experienced in Pascal and Basic (to an extent), and I've programmed in C before, so I know the basics :).

    So I could actually...
  9. Replies
    10
    Views
    1,213

    I suppose I was trying to mix to many different...

    I suppose I was trying to mix to many different styles there. Thanks for the help.

    (by the way, I was returning char& so I could say something like cout << foo(a,b);)

    Does it really matter if...
  10. Replies
    10
    Views
    1,213

    I don't suppose there's a way of doing that by...

    I don't suppose there's a way of doing that by using references in the argument list?
  11. Replies
    10
    Views
    1,213

    Really simple references/char question

    Hi, little problem with references, char*s and passing.

    To simplify the problem:

    #include <iostream.h>

    char& foo(char& c, const char& d) {
    cout << c << " " << d << endl;
    c = d;
    ...
Results 1 to 11 of 11