Search:

Type: Posts; User: Tool

Page 1 of 12 1 2 3 4

Search: Search took 0.01 seconds.

  1. Thread: bubble sort

    by Tool
    Replies
    3
    Views
    992

    Using structs, i suppose. Then writing your own...

    Using structs, i suppose. Then writing your own specialized bubble sort for the particular structure used.
  2. Replies
    48
    Views
    5,306

    Thanks you, rags_to_riches. :)

    Thanks you, rags_to_riches. :)
  3. Replies
    48
    Views
    5,306

    Oh my god. This is probably the only example...

    Oh my god.

    This is probably the only example in the book without the return statement, and i agree with authors taking it out - it's done because they didn't want to confuse beginners with...
  4. Replies
    48
    Views
    5,306

    Ofcourse - what i'm saying is that pieces will be...

    Ofcourse - what i'm saying is that pieces will be missing, MANY pieces, but you will have absolutely no problem in learning and easily comprehending those pieces.
  5. Replies
    48
    Views
    5,306

    You might be reffering to K&R first edition -...

    You might be reffering to K&R first edition - there might be such deprecated examples there, but i've never seen such a thing in K&R 2nd edition.

    Possibly, i've seen main() without int in front of...
  6. Replies
    48
    Views
    5,306

    I'm 100% sure i've never seen a K&R example with...

    I'm 100% sure i've never seen a K&R example with no return statement in main function.
  7. Replies
    48
    Views
    5,306

    Never had problems running any code from K&R in...

    Never had problems running any code from K&R in 2010, therefore i'm preety sure it conforms to the standard.

    The reason i am suggesting K&R is because i have read the whole book, did all the...
  8. Replies
    48
    Views
    5,306

    No, no and no! K&R is the best C book out...

    No, no and no!

    K&R is the best C book out there - made by creators of the C language.
  9. max num of simultaneously opened files in a c++ program.

    Is there a way to find this out?

    I looked up on google, but the only related thing i found is _setmaxstdio which is a C function. I suppose it also applies in C++?

    Also, what does this depend...
  10. Replies
    6
    Views
    1,511

    So, a good thing to do would be to include type...

    So, a good thing to do would be to include type definitions into a .h file and then just include the .h file in the files which depend on those types?
  11. Replies
    6
    Views
    1,511

    internal/external linkage

    I was wandering why this works:

    file1.cpp


    #include <iostream>

    struct Point {
    int a, b;
    };
  12. Replies
    25
    Views
    1,923

    if(gross_income>=2000) ...

    if(gross_income>=2000)
    if(gross_income<=4000)//second salery step


    Something like this?
  13. Replies
    1
    Views
    926

    passing 2d arrays to functions

    Is there a way to pass a 2d array to a function without the function knowing how many elements each row has?

    If not, i'm interested about what does "inverting" a 2d array means?

    Replacing first...
  14. Replies
    1
    Views
    747

    ptrs to function names

    "How would you choose names for pointer to function types defined using typedef"?

    This is one of the questions in The C++ Programming Language book by Bjarne.

    So what do you think are...
  15. Replies
    1
    Views
    1,882

    inverting an 2d array

    What does that exactly means?

    The problem states:

    Write a function to invert a two dimensional array.


    Does this means reversing each row of the matrix?
  16. Thread: When to stop?

    by Tool
    Replies
    4
    Views
    890

    When to stop?

    So, while learning C++ from the stroustrup's book i often wandered this.

    At some point of the book, "inline" keyword is introduced in the book, it is described a little with no examples.

    So,...
  17. Thread: crashing

    by Tool
    Replies
    4
    Views
    834

    True, i figured that just out. Thanks. I'll look...

    True, i figured that just out. Thanks. I'll look it up...
  18. Thread: crashing

    by Tool
    Replies
    4
    Views
    834

    crashing

    Hm, the code seems to crash in merge_stats function (i marked it red) and i have no idea why? When i enter only one name and value, it's ok, but when i enter more then one name and value it...
  19. Replies
    1
    Views
    688

    reinterpreting variables etc

    #include <iostream>

    using namespace std;

    int main(int argc, char *argv[])
    {
    //undefined behaviour?
    int i = 100;
    *(char *)&i = 25;
    cout << i << endl;
  20. Thread: not compiling...

    by Tool
    Replies
    8
    Views
    1,213

    Well... the original code was this: ...

    Well... the original code was this:



    #include <iostream>
    #include <iterator>
    #include <list>
    #include <algorithm>
    #include <set>
  21. Thread: not compiling...

    by Tool
    Replies
    8
    Views
    1,213

    not compiling...

    #include <iostream>
    #include <list>
    #include <algorithm>
    #include <set>
    #include <iterator>

    using namespace std;

    int main()
    {
  22. Replies
    1
    Views
    2,083

    initialize an array of strings

    Is it more correct to do it with constructors, or just passing a const char pointer?



    #include <iostream>

    using namespace std;

    int main()
    {
  23. Replies
    2
    Views
    903

    operator >> return value

    I'm a bit confused about what the expression belove in the code returns.


    cin >> buf;

    And how can it be used in a while loop:


    string buf;
    while(cin >> buf) //extracts until eof
  24. Replies
    2
    Views
    675

    weird compile error

    template <class C, class T> int count2(const C &v, T val)
    {
    C::const_iterator i = find(v.begin(), v.end(), val);
    int n = 0;
    while(i != v.end()) {
    ++n;
    ++i;
    ...
  25. Thread: error compiling

    by Tool
    Replies
    8
    Views
    1,343

    error compiling

    #include <iostream>
    #include <vector>

    using namespace std;

    struct Entry {
    string name;
    int number;
    };
Results 1 to 25 of 280
Page 1 of 12 1 2 3 4