Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Philip Nicoletti

Page 1 of 80 1 2 3 4

Search: Search took 0.16 seconds.

  1. Re: Little/Big Endian test code in machine and file

    CFD codes write out in binary, since writing "text"s would be considerably slower and increase the size of data written. They usually take care of it one of two ways:

    1) similar to "netcdf...
  2. Replies
    8
    Views
    314

    Re: c++ stl map

    You have:



    //.cpp
    std::map<u8, u8> m_mlistOfCliConfiguredPolicyRules = boost::assign::map_list_of(Apn_Fred, 9);


    I am guessing it should be:
  3. Replies
    8
    Views
    314

    Re: c++ stl map

    boost::assign::map_list_of("PolicyRule_Fred", PolicyRuleInfo( BearerQoSInfo(9), TFTInfo()))

    //

    listOfPolicyRuleInfo::iterator it = m_mlistOfCliConfiguredPolicyRules.find("PolicyRule _Fred");
    ...
  4. Re: Using upper_bound() and lower_bound() (from the 'algorithm' header)

    It depends on how the iterators are used. For example, if the vector is not sorted, it is possible that
    the upper_bound iterator could end up "before" the lower bound iterator. Look at what would...
  5. Re: Using upper_bound() and lower_bound() (from the 'algorithm' header)

    1) is the vector sorted ?

    2) How are you using the returned iterators ? It should be something like:



    for (auto it=it_lower; it!=it_upper; ++it)
    {
    // use it
    }
  6. Re: Problem with empty/null string/char...

    Just a note: many c-functions that take a char * have undefined behavior if you send a null. Example:



    char * p =0;
    int n = strlen(p);
  7. Replies
    6
    Views
    323

    Re: Nested containers ...again :(

    It might be clearer removing the range based for loop:



    for(auto it=n_tuple.begin(); it!=n_tuple.end(); ++it)
    {
    auto pt = *it; // this copies the vector *it into the...
  8. Replies
    6
    Views
    323

    Re: Nested containers ...again :(

    I didn't really understand your question, but ...



    std::set< std::vector<int> > n_tuple = unique_n_combinations (seq, n) ;
    for(auto pt : n_tuple) // so pt is of type vector<int>
    ...
  9. Re: What is the common technique of using pointers to change some value on the fly?

    yes.

    If you have the second edition of "The Standard C++ Library" by Josuttis, this is explained in section 15.11.3 (Input/Output using auxiliary functions).

    It is also explained in the first...
  10. Replies
    15
    Views
    701

    Re: Calculate error Pi value ------

    Your code is difficult to follow/modify with the use of all the "magic numbers". That is, what if you want to use 20000 rectangles instead of 10000, you would need to change the code in multiple...
  11. Replies
    15
    Views
    701

    Re: Calculate error Pi value ------

    The height is supposed to be calculated at the mid-point of the rectangle. It looks like you are calculating it a the left vertex.
    Maybe you should initialize x as:


    x = 0.5 / 10000.0;
  12. Replies
    15
    Views
    701

    Re: Calculate error Pi value ------

    why is "sum" declared as an int variable ?
  13. Replies
    7
    Views
    341

    Re: accessing nested elements...

    For readability, I sometimes do the following:


    // given :

    set<vector<int>> s;
  14. Re: Creating a text file for randomly generated numbers

    No. You only need to do that because you are specifying fstream::in (why are you doing that ??)
    Since you are using fstream:app, every time you run the program, data will be appended to the
    file if...
  15. Re: Creating a text file for randomly generated numbers

    You have:



    ofstream random_numbers("D:/StudentData/Documents/DataStructures/SortingAlgorithms/randIntContainer.txt");


    That creates/opens the file.

    Then in main(), you try to open it...
  16. Replies
    8
    Views
    457

    Re: Freeglut in VS2010

    A long time ago I used glut with Mui (a micro user interface that came with glut).

    I just gave values to those variables. Something like:



    int argc = 1;
    char * argv[] = { "your_exe_name"...
  17. Re: compile with terminal from MyProject folder

    It depends on where you execute the executable from (and maybe even if you execute from an IDE or not).

    If you execute from the terminal in the MyProject folder it would probably be:


    ...
  18. Re: compile with terminal from MyProject folder

    You missed typed the name in the header folder:

    Funcitions.h
  19. Re: compile with terminal from MyProject folder

    from the MyProject folder, can you do the following command and copy/paste the output ?

    ls -alR
  20. Re: compile with terminal from MyProject folder

    -Iheader

    Are you getting the same errors ? What operating system are you using ? On Linux systems, filenames are case sensitive.
  21. Re: compile with terminal from MyProject folder

    You need to specify where the headers are located (looking at the help for gcc would show this):



    g++ -Wall -o myproject -Iheader source_files/functions_cpp.cpp source_files/main.cpp
  22. Re: A question from the book "More effective C++".

    1) Maybe try to change the dynamic allocation to: D pD[6];

    2) see the following code. For simplicity, I made B's member variable public and added a variable to D to make it unlikely that...
  23. Replies
    17
    Views
    701

    Re: Working with fractions

    You have:


    numerator = (numerator / GCD());
    denominator = (denominator / GCD());


    the first line changes the value of numerator which is used by GDC(). So the call to GCD() in the second...
  24. Replies
    2
    Views
    284

    Re: Best C++ GUI Library/IDE

    I use both the Microsoft's IDE and MFC (with Visual C++) and QT Designer (with Visual C++)

    I like them both.

    For Qt, you can bring up QT Designer, click on the "Welcome Tab" and then on the...
  25. Re: Difficulty in Copy Assignment in C++

    I think that will fail when doing self assignment ( a = a )
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center