Search:

Type: Posts; User: jlf029

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    1,946

    If you still want to use your char array you must...

    If you still want to use your char array you must make it dynamic otherwise your compiler expects a constant.
    For example:



    cin >> N;
    char** mat = new char*[N];
    for(int i=0;i<N;i++)
    ...
  2. Replies
    5
    Views
    1,756

    while (fin>>val) { sum = sum + val;...

    while (fin>>val)
    {
    sum = sum + val;
    count++;
    }


    I think this shouold work
  3. Replies
    19
    Views
    2,258

    something like: if(argc!=2) { cout

    something like:


    if(argc!=2) {
    cout << "Wrong arguments specified\n";
    exit(0);
    }
  4. Replies
    11
    Views
    1,471

    Maybe you can cast it? char...

    Maybe you can cast it?


    char boss=((char)(boss_beaten+1));//where boss_beaten is a int
  5. Thread: Saving Data

    by jlf029
    Replies
    5
    Views
    1,862

    why not just store it as a binary file?

    why not just store it as a binary file?
  6. Replies
    6
    Views
    1,728

    if you are using char[] arrays, you can simply...

    if you are using char[] arrays, you can simply swap the elements
  7. Replies
    35
    Views
    5,497

    i use quincy 2005 cos its simple and it gets the...

    i use quincy 2005 cos its simple and it gets the job done. I like freesing f9 to compile. It's better than command lining.
  8. Replies
    11
    Views
    2,278

    your sum should also be a double! #include...

    your sum should also be a double!


    #include <iostream>
    #include <iomanip>
    #include <cmath>

    using namespace std;

    int main ()
  9. Thread: binary search

    by jlf029
    Replies
    6
    Views
    876

    thirdly else if (num marray.a[mid]) this wont...

    thirdly
    else if (num marray.a[mid])
    this wont even compile
  10. Thread: binary search

    by jlf029
    Replies
    6
    Views
    876

    firstly while (low = high) should be low==high

    firstly
    while (low = high)
    should be low==high
  11. Replies
    7
    Views
    1,774

    we were always taught to use eof by reading the...

    we were always taught to use eof by reading the first value in before the eof loop. You can always use eof and in the loop check for if(var.fail()) break;
  12. Replies
    15
    Views
    1,885

    use if statements with the cstring function strcmp

    use if statements with the cstring function strcmp
  13. Replies
    5
    Views
    1,933

    use setprecision(2) with cout and include...

    use setprecision(2) with cout and include <iomanip>
    eg

    int x = 2.143234234;
    cout << setprecision(2) << x << endl;
  14. Thread: strlen probs

    by jlf029
    Replies
    7
    Views
    961

    dont use ios::binary leave that parameter out...

    dont use ios::binary leave that parameter out then try cin.getline(tbuffer);
  15. Replies
    3
    Views
    956

    what is testnum ? You are always have it set to 0

    what is testnum ? You are always have it set to 0
  16. Thread: pointers

    by jlf029
    Replies
    10
    Views
    1,200

    Have you tried learning them?

    Have you tried learning them?
  17. You are saying that each class has its own print...

    You are saying that each class has its own print function, you could call the superclass print function by saying Base::PrintData();
  18. Replies
    8
    Views
    1,108

    lol, nothing wrong

    lol, nothing wrong
  19. Replies
    22
    Views
    27,805

    constructors dont have return types

    constructors dont have return types
  20. Replies
    2
    Views
    2,192

    You mean its actual source code?? if so just...

    You mean its actual source code??
    if so just read in char by char with cin.get(ch); and open the file as
    ifstream fin(__FILE__);
  21. Thread: stack class

    by jlf029
    Replies
    3
    Views
    913

    im so lost.

    im so lost.
  22. Thread: stack class

    by jlf029
    Replies
    3
    Views
    913

    stack class

    Ok, I've got my stack class I made, but as you know if I push 1,2,3 in a stack i would expect 3 to get popped out first right?

    Mine doesn't!!! What's wrong?



    template <class T>
    class List...
  23. Replies
    3
    Views
    1,180

    yup he's right

    yup he's right
  24. Replies
    18
    Views
    3,064

    You cant put variables in arrays unless they are...

    You cant put variables in arrays unless they are constants.

    const int SIZE = 10;
    int array[SIZE][SIZE];

    or dynamically
    int **matrix;
    int n;
    matrix = new int*[n];
    for(int i=0;i<n;i++)
  25. Replies
    18
    Views
    3,064

    You can only have constants for array sizes, they...

    You can only have constants for array sizes, they can't be variable.
    You will have to use dynamic memory.



    int n;
    int *matrix;
    cout<<"Please enter how many integers per line [ 1 <...
Results 1 to 25 of 85
Page 1 of 4 1 2 3 4