Search:

Type: Posts; User: rahulsk1947

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    1,465

    oops..i think my program terminates once i input...

    oops..i think my program terminates once i input a value to exit.
    So therefore never saw my destructors.


    any way to see the destructor being called?
  2. Replies
    8
    Views
    1,465

    destructor not called

    Hi,my following code..the destructor never gets called !


    #include <cstdlib>
    #include <iostream>
    #include <iomanip>

    using namespace std;

    class Base{
  3. Replies
    2
    Views
    1,000

    unhandled execption

    Hi, i got this program to book seats for a cinema show.if trying to book seats already booked,a exception is thrown.code is as follows.

    try{
    if(ifFoundBookedSeats==true){...
  4. Replies
    7
    Views
    2,058

    debug assertion failed

    hi,i got the following code.it compiles welll.but when running,it gives a"debug assertion failed" error.



    #include <iostream>

    class test{
    public:
    char *fileName;
    test(char *r){
  5. Replies
    6
    Views
    3,208

    virtual outside class declaration

    hi, did this declaration for my virtual desctructor.it continues to give me this error:virtual outside class declaration using dev c++ compiler



    #include <iostream>
    using namespace std;
    ...
  6. Replies
    6
    Views
    3,208

    virtual destructor SYNTAX

    Hi, i got a destructor for a class Base1.
    my syntax/format is wrong. can some-one correct it for me?




    Base1::virtual ~Base1() {
    cout << "Destroy Base" << endl;
    }
  7. Replies
    1
    Views
    1,200

    default constructor

    class base{
    private:
    int x;
    public:
    base(){
    x=4;
    }
    };

    is it correct to do this? set x=4 in a default constructor? want'ed to set the initial value of...
  8. Replies
    4
    Views
    947

    i convereted it to: ...

    i convereted it to:

    derieved1*sb=dynamic_cast<derieved1*>(bbbb);
    derieved2*sb1=dynamic_cast<derieved2*>(bbbb);


    It gives me a error.

    'dynamic_cast' : 'base' is not a polymorphic type
  9. Replies
    4
    Views
    947

    casting error

    Hi,
    i got a base class,and 2 derieved classes.derieved1 and derieved 2.

    In the main class,i create a derieved1 and derieve2 object. add it to vector vector<base*> list .

    Then i try casting...
  10. Replies
    4
    Views
    3,536

    c++ validation

    i have developed a program.lot of text and numeric inputs.


    input needs to be validated.


    1) All the validation is done right after we read it in by cinn>> ?

    2) There might be lot of...
  11. Replies
    6
    Views
    3,331

    thanks for reply. my program was all the...

    thanks for reply.


    my program was all the while acesing the vector by index only. and the find function uses iterators. i got redesign my program now.

    # was my program design wrong of...
  12. Replies
    6
    Views
    3,331

    vector search and replace

    Hi,
    i got a vector<int> of values 12,49,51,98

    i wanted to search for value 12 and replace it with another value like 42.

    is there any vector function to search and replace straight away?
    ...
  13. Thread: vector

    by rahulsk1947
    Replies
    4
    Views
    987

    vector

    Hi,
    I got a class student.

    And a vector<student> listOfStudents.

    Wanted to ask,which is best way to store this vector.


    vector<student> listOfStudents; //method A
    vector<student*>...
  14. Replies
    1
    Views
    1,805

    vector : accessing values

    eg: vector<int> listOfValues

    Hi,
    Vectors can be accessed by index like listOfVaules[9]
    OR
    by iterator.

    which is the best way of accessing? is accessing by index a bad practice?

    Thanks,
  15. Replies
    4
    Views
    1,099

    method commenting

    Hi,i got a method


    void searchStaff(string staffID){
    }

    I want to write a comment on top to describe the method.

    i did this:
  16. Replies
    2
    Views
    839

    class constructor

    Hi,
    i got a class:


    class base{
    private:
    int age;
    public:
    base(int);
    };
  17. Replies
    4
    Views
    2,380

    class definition error

    I am writting a simply inheritance test program. Master class is dad class. class son and daughter is derieved from dad.

    my code :
    dad.h

    #include <iostream>
    using namespace std;
    class dad{...
  18. Replies
    3
    Views
    1,679

    I want to tokenise a string(in string format)...

    I want to tokenise a string(in string format) base on specified delimiters.



    void getTokens(char str[],char delims[]){

    char *result = NULL;
    result = strtok( str, delims );
    ...
  19. Replies
    3
    Views
    1,679

    string to char* or char[]

    Hi,
    i want to convert a string to char * or char[]

    i tried:


    string a="123";
    char *b=a.c_str();
  20. Replies
    1
    Views
    1,477

    C++ inheritance

    lets say i have base class a
    and class b is inheriting class a.

    in class a we have a function called convert().in convert we create a object of type b.

    Is this correct?

    It compiles and...
  21. Replies
    1
    Views
    2,664

    memory leak checker program? for windows

    Hi,

    i am writing a c program.want to check if it leaks memory.

    I am compiling and runing on windows platform.Using the visual c++ toolkit compiler or the dev c++ compiler.Find them reliable.
    ...
  22. Replies
    2
    Views
    1,752

    memory leak

    Hi i got a program to store words and number of spaces after each word.
    Words would be in a word node.the code is:



    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>...
  23. Replies
    2
    Views
    7,286

    divide long by double

    HI,i was trying to do the following.I tried but cant figure out my error.I want the output to be 123.456


    #include <stdio.h>

    int main(void){

    unsigned int a=123456;
    double b=a/1000;
  24. Replies
    2
    Views
    1,656

    file append

    Hi,
    i got a input text file,its data is as follows:
    *the number dont exist in the input test file,added for reference only*


    1. intial line
    2. second line of file
    3. hope you are having great...
  25. Replies
    5
    Views
    1,554

    trying to make into list of students

    thank you for your help.I have then proceeded to make it into a list of students.I get an error again.I dont know what wrongs



    #include <stdio.h>
    #include <stdlib.h> /* for malloc */
    ...
Results 1 to 25 of 60
Page 1 of 3 1 2 3