Search:

Type: Posts; User: rox

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    0
    Views
    1,235

    please delete.

    nevermind, me dumb :)

    admin, please remove this post!
  2. Thread: what call is this?

    by rox
    Replies
    9
    Views
    1,207

    god damn it... it compiles, works and passed all...

    god damn it... it compiles, works and passed all the test on AIX but it gives a segmentation fault on my personal linux box...

    is there something wrong in my program or it's just the compiler not...
  3. Thread: what call is this?

    by rox
    Replies
    9
    Views
    1,207

    ok, so I make my init like so: void...

    ok, so I make my init like so:


    void Account::init(const char c[], const char num[], int b){
    cout<<"in init next is check for customer"<<endl;
    if(customer) {
    delete [] customer;
    }...
  4. Thread: what call is this?

    by rox
    Replies
    9
    Views
    1,207

    so I'm doing customer = new...

    so I'm doing

    customer = new char[strlen(acct.customer) + 1];
    but than when I copy with

    strcpy(customer, acct.customer);
    the end of string does not get copied, right? do I have to add it in...
  5. Thread: what call is this?

    by rox
    Replies
    9
    Views
    1,207

    This is in main: char d[] = " ...

    This is in main:


    char d[] = " 113423454567987,83456,Baker,Susan,St. Louis-de-ha-ha,416-555-5599;";
    char num[] = "aw0000000000000";
    Account two(d, num, 5347);
    Account three;...
  6. Thread: what call is this?

    by rox
    Replies
    9
    Views
    1,207

    what call is this?

    If five and two are objects of type Account, this should not be a call to a copy constructor?


    Account five(two);

    copy constructor being declared:


    Account::Account(const Account & acct){
  7. Thread: delete - hot to

    by rox
    Replies
    4
    Views
    1,047

    great, that gdb is amazing, i had no ideea...

    great, that gdb is amazing, i had no ideea there's a debugger for prompt.
    I was under the impression that only heavy-graphical-interface applications have a debugger.
    (you learn something every...
  8. Thread: delete - hot to

    by rox
    Replies
    4
    Views
    1,047

    ok, i've pinpointed it to this: class A { ...

    ok, i've pinpointed it to this:


    class A {

    char * cr; //No memory allocation yet.

    public:
    //...............
    ~A();
  9. Thread: delete - hot to

    by rox
    Replies
    4
    Views
    1,047

    delete - hot to

    i have a set of objects of class A as a data member of an object of class B using dynamic memory allocation. In A i got strings with dma.

    delete [] A;

    gives me a segmentation fault...

    it...
  10. Thread: logic question...

    by rox
    Replies
    1
    Views
    1,319

    logic question...

    i got a class bank, with one data member of type account (other class)...
    i need to create a function grow that increases the number of acounts by a certain number...
    in order to dynamically...
  11. Replies
    3
    Views
    1,852

    ok, there are no blanks on the first string, up...

    ok, there are no blanks on the first string, up to the first comma, than there is the integer value, and than there is another string containing characters, commas, blank spaces and who knows what,...
  12. Replies
    3
    Views
    1,852

    reading from a text file.

    how do you read from a text file containing data in the following format:

    someChars,integer,SomeCharsWithOtherCommas;someChars,integer,.... and so on.

    I've tryed


    fscanf(file, "%s,%d,%s;",...
  13. Replies
    6
    Views
    1,045

    yes i did, i got it to work. THank you!

    yes i did, i got it to work.
    THank you!
  14. Replies
    8
    Views
    1,040

    Great, now it makes sense. And it works too, but...

    Great, now it makes sense. And it works too, but that comes as a bonus only :)

    Thank you very much!
  15. Replies
    8
    Views
    1,040

    because the function prototypes given have that...

    because the function prototypes given have that last "const" in there. So i'm just trying to figure out what it does. I found some examples in a book but i'm still clear as mud on this.
  16. Replies
    8
    Views
    1,040

    ok, got it... this works... but what is the last...

    ok, got it... this works... but what is the last const doing in a function prototype like this:


    const char* getSomething(int index) const

    without that const it work like a charm, with it......
  17. Replies
    8
    Views
    1,040

    rephrasing my question (clearer i hope).

    how do i get into a tempstring a string value from a data member of an object in an array of objects?

    i thought it was:

    strcpy(tempstring, array[index].getFunction() );

    where the function...
  18. Replies
    6
    Views
    1,045

    i think i understand the idea, and i think it's...

    i think i understand the idea, and i think it's case 3...

    one of the data members in class bbb is an array of objects type aaa.

    i'm trying to return from a member function in bbb the return of...
  19. Replies
    6
    Views
    1,045

    sorry, i think i pasted the wrong segment of...

    sorry, i think i pasted the wrong segment of code...

    in aaa i got:

    const char* getSomething();

    and in bbb:


    aaa somearray[10];
  20. Replies
    6
    Views
    1,045

    classes & member function question...

    wrong code posted. see down!

    the error i get is:


    bbb.cpp: In member function `int bbb::getSomething(int) const':
    bbb.cpp:261: passing `const aaa' as `this' argument of `int
    ...
  21. Replies
    1
    Views
    1,015

    really dumb beginner question on include

    ok, i got this:

    a cpp file declaring a class, with it's header file containing function prototypes.

    another cpp file containing a new class of objects of the previous class with another header...
  22. Replies
    5
    Views
    2,258

    great, thank Prelude. Now it makes sense. ...

    great, thank Prelude. Now it makes sense.

    Couldn't they put that info in the book too? grr.
  23. Replies
    5
    Views
    2,258

    Thank, so my suspicion was right. Problem was,...

    Thank, so my suspicion was right.

    Problem was, i got some function definition given, and until now i was using them the way they were given. Now they only gave me :


    FILE* fuctionName(char [])...
  24. Replies
    5
    Views
    2,258

    working with file name [] ???

    beginner confused here:


    FILE* functionName(char [])

    where i pass a string as the file name, open the file and return fp.

    how do i work with the passed string? Should i have a name[]...
  25. Thread: read a line

    by rox
    Replies
    7
    Views
    1,371

    :( it appears i am. I've had strings...

    :( it appears i am.

    I've had strings mentioned only last week, and only how to read them from the input.

    i don't have a problem reading more about it, but i'm not even sure what to lok for...
Results 1 to 25 of 35
Page 1 of 2 1 2