Search:

Type: Posts; User: jimzy

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    2,364

    void bookType::checkTitle(string chkTitle, bool...

    void bookType::checkTitle(string chkTitle, bool search)
    {
    //Search for title
    if (chkTitle == bookTitle) {
    cout << "1 Book(s) found with that title.";
    search = true;
    ...
  2. Replies
    6
    Views
    2,243

    Different number of stars is printed, depending...

    Different number of stars is printed, depending on score.

    But still, wouldn't it be nicer to split this code into functions (big if-else-if I mean)? It looks like could be easily unified, using...
  3. Replies
    18
    Views
    2,333

    If you call isLarger() in CDate class, you might...

    If you call isLarger() in CDate class, you might want to dereference 'this' when passing to function, as it is pointer.



    isLarger(*this, secondDate)


    instead of
  4. Replies
    18
    Views
    2,333

    Once you have function declared to take arguments...

    Once you have function declared to take arguments by references (as laserlight proposed), you simply call it this way:



    CDate firstDate, secondDate;

    if ( isLarger(firstDate, secondDate) )...
  5. Replies
    2
    Views
    4,431

    Oh, thanks a lot brewbuck, works now :-)

    Oh, thanks a lot brewbuck, works now :-)
  6. Replies
    2
    Views
    4,431

    Simple makefile problem

    Hello,
    As I'm writing some simple email server app, I decided it's probably good idea to create my very first makefile.. Guess it didn't go that well... :confused:



    OBJ = main.o...
  7. Thread: ISO or C++/CLI?

    by jimzy
    Replies
    9
    Views
    1,757

    There's a Project Mono, attempting to make .NET...

    There's a Project Mono, attempting to make .NET available on other platforms (I've seen it running on Linux).

    I'd also recommend going for C# when it's about .NET and sticking to native C++...
  8. Or, he could use a kind of bitmask (that could be...

    Or, he could use a kind of bitmask (that could be a copy of given string, since he said he cannot use arrays), and while iterating for matches in original string, set 0,1 (or some other value you...
  9. Replies
    21
    Views
    2,791

    Also, first you should get the number, and then...

    Also, first you should get the number, and then pass it to function that will display table. At the moment you're doing it in wrong order.
  10. Replies
    8
    Views
    14,779

    Not sure if that's what you mean, but I run into...

    Not sure if that's what you mean, but I run into something that solves the whole reference problem, let's say:



    public ref class Foo
    {
    int^ var;
    public:
    Foo()
    {
  11. Replies
    8
    Views
    14,779

    That's what I'm doing now, was just hoping...

    That's what I'm doing now, was just hoping somebody knows more "managed" solution to such problem :-)
  12. Replies
    8
    Views
    14,779

    Yes, it seems so. However, second window class...

    Yes, it seems so. However, second window class (as in my example) is supposed to be managed too. Thing is, managed objects cannot by passed by native C++ reference (&) (even to managed class' own...
  13. Replies
    8
    Views
    14,779

    Well, I need original values to be modified, and...

    Well, I need original values to be modified, and passing by value won't help then. Question that remains unaswered is, how to pass managed class data by reference, if that's even possible. (as for...
  14. Replies
    8
    Views
    14,779

    Managed C++, passing arguments by reference

    Hi there,
    To quickly ilustrate my problem, say I got a ref class that's creating a window, with some variable as well as handle to second window which should modify mentioned variable, eg:


    ...
  15. Replies
    80
    Views
    7,633

    Since pointers and references are being...

    Since pointers and references are being discussed, I just thought somebody could clear this up - which of following functions is more appropriate to use in C++? Or maybe there's a "better" C++ way of...
  16. Replies
    6
    Views
    1,206

    As robatino explained. By assigning 0 to result,...

    As robatino explained.
    By assigning 0 to result, this


    if (result = 0)
    {
    // ...
    }

    won't be true, and code inside this if won't execute. Same story goes for:
  17. Replies
    6
    Views
    1,206

    Is this really what you meant?

    Is this really what you meant?
  18. Replies
    8
    Views
    1,355

    You could put part of the code that's displaying...

    You could put part of the code that's displaying menu-info into separate function, eg.



    void printMenu()
    {
    printf("1.) Integer to Binary converter\n");
    printf("2.) Fibonacci...
  19. Replies
    5
    Views
    1,226

    int main() { //Input variables ...

    int main()
    {
    //Input variables


    greet();
    calc();
    display();

    return 0;
  20. Replies
    11
    Views
    7,481

    Okay, maybe I could help here: int main...

    Okay, maybe I could help here:



    int main (void) // see FAQ entry here
    {
    int number, bin, counter = 0; // you're starting accessing array at first index, which is 0
    char bina[32];...
  21. Replies
    11
    Views
    7,481

    I'm not sure if I understand you correctly, but...

    I'm not sure if I understand you correctly, but if you want to convert int to displayable binary, one quick approach would be to store remaining parts of division (which is either 1 or 0) in char...
  22. Replies
    6
    Views
    1,012

    Did you look at strcpy prototype? char *...

    Did you look at strcpy prototype?


    char * strcpy ( char * destination, const char * source );
  23. Replies
    4
    Views
    1,326

    Perhaps you could try this: int** foo(int x,...

    Perhaps you could try this:


    int** foo(int x, int y)
    {
    int** arr = malloc ( x * sizeof( *arr ) ); // allocate memory for rows
    int i;
    for ( i = 0; i < x; i++ ) // for every...
  24. Thread: For loop

    by jimzy
    Replies
    6
    Views
    1,698

    Problem lies in this loop stop condition - ...

    Problem lies in this loop stop condition -


    for (i = j; i >= n; i++)


    Think about any input, and how many times will this loop execute. It's for negatives, just remember.
  25. Replies
    18
    Views
    2,401

    Ahh... thanks a lot matsp, knew it was going to...

    Ahh... thanks a lot matsp, knew it was going to be silly :confused:
Results 1 to 25 of 42
Page 1 of 2 1 2