Search:

Type: Posts; User: rozner

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    1,173

    That actually makes sense, thanks for the...

    That actually makes sense, thanks for the explanation. It works great now.
  2. Replies
    3
    Views
    1,173

    operator overloading for streams

    Hi,

    This one's not so important but, nice to have. I've been playing with the operator overloading for some simple classes and it's quite nice. I found some examples of overloading << which don't...
  3. Replies
    7
    Views
    4,784

    hmm... this looks interesting. I may give that...

    hmm... this looks interesting. I may give that one a try. I wish I had more time to work on this... at least I'm learning more C++ :) I had the option to do this assignment in Java but I wanted to...
  4. Replies
    7
    Views
    4,784

    well, you're right, my Java example was more...

    well, you're right, my Java example was more along the lines of how you can compare anything to null (except for the primitives). But here's another question which my resolve this issue altogether....
  5. Replies
    7
    Views
    4,784

    how can I check for a bad iterator

    Hi,

    I'm doing some stuff with iterators in my code. I occasionally run into problems with a global iterator being set in one place and used somewhere else. Most of the time it works properly, but...
  6. Replies
    1
    Views
    6,543

    scaling function

    Hello,

    I am working on a school assignment and have one small problem. Here's the general description of the assignment:

    Create an openGL program (2D) that can be used to be a street map of a...
  7. Replies
    6
    Views
    2,097

    ok, so it turns out it had nothing to do with the...

    ok, so it turns out it had nothing to do with the vector code above. Using the debugger properly as you suggested I was able to see exactly where it was screwing up. Thanks.
  8. Replies
    6
    Views
    2,097

    that was my thinking, that the break would avoid...

    that was my thinking, that the break would avoid this problem, and to be more clear, this is a runtime problem, it compiles fine.

    I haven't tested your suggestion yet, I'm not sure if it will...
  9. Replies
    6
    Views
    2,097

    need help with vectors

    hi,

    I'm having some trouble with a vector. I'm at a point where I need to remove and object from the vector and I inconsistently receive the error:

    "vector iterator not dereferencable"
    ...
  10. Replies
    5
    Views
    1,521

    I have several different objects (2 for now, but...

    I have several different objects (2 for now, but maybe more later), that are basically Rectangles but have certain differences (hence the subclasses). I don't really see how this is a design error,...
  11. Replies
    5
    Views
    1,521

    vectors and polymorphism

    Hi,

    I'm having an issue trying to pass a vector to a function.

    The function parameter is of vector<base_class>, then I'm actually passing vector<sub_class>, but it doesn't work.

    Is it...
  12. Replies
    6
    Views
    1,492

    interesting, I like the last suggestion, I think...

    interesting, I like the last suggestion, I think I may try that,

    Thanks for the input
  13. Replies
    6
    Views
    1,492

    constructor overloading question

    Hi,

    I've been working with Java for a while and had minimal c++ experience before, although a lot of c experience. So most of the problems I'm running into have to do with the way c++ handles...
  14. Thread: popen problem

    by rozner
    Replies
    2
    Views
    1,963

    thanks, it actually works fine with fprintf after...

    thanks, it actually works fine with fprintf after removing the \n
    I will try with fputs as well
  15. Thread: popen problem

    by rozner
    Replies
    2
    Views
    1,963

    popen problem

    Hi,

    I have been learning about pipes in C recently. Here is an example of some code that works fine:



    // some lines are omitted
    switch(fork()) {
    case -1:
  16. Replies
    12
    Views
    1,535

    well, thanks for all the input on this one, I...

    well, thanks for all the input on this one, I guess I'll try the GOTO, it'll be first for me in C.
  17. Replies
    12
    Views
    1,535

    well...from what I've heard and read about GOTO,...

    well...from what I've heard and read about GOTO, and the fact that you call it EVIL, I'll probably stay away from it. Thanks anyways.
  18. Replies
    12
    Views
    1,535

    breaking multiple loops

    Hi,

    I would like to know if it is possible to break a loop from inside another loop. In Java this is possible like so:




    myloop:
    for(; ; )
    for(; ; )
  19. Replies
    3
    Views
    1,348

    thanks alot, I will make some modifications

    thanks alot, I will make some modifications
  20. Replies
    3
    Views
    1,348

    overloading

    Hi,

    I am trying to overload << as a friend class. As far as I understand, if class "a" declares "friend class b" then class b should be able to access all private and public members of class a, if...
  21. Replies
    4
    Views
    1,602

    thanks, but I kind of figured out an alternative...

    thanks, but I kind of figured out an alternative solution. I was freeing the memory every time I add a new customer. So I moved that into a new function that will free the memory when you quit the...
  22. Replies
    4
    Views
    1,602

    need help with structs and pointers

    I have this program that almost works. I have a typedef struct called Customer with several fields. Two of them are char* which will be to store strings. I have an array of Customer, but whenever I...
  23. Replies
    2
    Views
    1,794

    how to cast a char to an int

    Hi, I actually have two questions about this code. One is in the subject line. I want to basically read in a string and make sure it is an integer which works fine. But then I want to cast it to int...
  24. Replies
    2
    Views
    1,546

    Thanks a lot. This helps. I do apologize for...

    Thanks a lot. This helps. I do apologize for asking easy questions, but I just started coding C a week ago. Vber, you were right about that fprint as well. Salem, I originally had fflush(fp) but I...
  25. Replies
    2
    Views
    1,546

    how to make an array of strings

    I know a string is just an array of chars, but how can I make an array of strings?


    #include <stdio.h>
    #define length 80

    void main(void) {

    FILE *fp;
    int ch;
Results 1 to 25 of 26
Page 1 of 2 1 2