265 Topics
is there a package for c++ that will allow me to make a matlab/gnuplot style plot from within c++? I would like to skip the step of writing data to a file and then using something else to read in the data and then plot it. Let me know what … | |
I have a class called MyClass in main, I have [code] MyClass A; //calls the default constructor A.date = 4; [/code] I would like a function to do some stuff and then use one of A's constructors , the result being I have A back in main [code] class MyClass … | |
I found _isnan() in float.h for VS2008, but I would like to SET a variable to a NaN intentionally, not check if it is one. Is this possible? Thanks, David | |
I made a library (.lib) with VS2005. Is there a way to convert it to a .a linux library without moving the code and setting up a project and compiling in linux? Thanks, David | |
I am getting a whole bunch of these: warning C4996: 'vsprintf' was declared deprecated see declaration of 'vsprintf' Message: 'This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. I put this at the top of my code: #define _CRT_SECURE_NO_DEPRECATE but nothing changed, I … | |
This is a very general question. I'm sure there is no "right" way so I thought I'd ask for opinions/common practice. In my file MainProgram.cpp (containing main()), sometimes I will have LOTS of functions. It seems very distracting to have a thousand lines of code all in the same file, … | |
I wrote a simple class: c:\geometry\Point.h c:\geometry\Point.cpp I made a VS2005 project and added a Source File test.cpp which contains main(). In test.cpp, I #include "c:/geometry/Point.h" When I build the project I get: Unresolved external symbol "public: __thiscall Point::Point(double,double,double)" referenced in function _main. However, if add Point.h to my Header … | |
Last week I asked about this so I tried to write another example to try it out. I have a Line class which needs to have and members of type Point and member functions that return type Point. The Point class needs to have member functions that return type Line … | |
I am trying to use OPT++ for multidimensional optimization with Visual Studio 2005. I added the include directory to my project. I added the lib directory to my project. When I try to compile the example that ships with the package, i get 102 of the same error: NEWMAT is … | |
Anyone know a good package that will take a multidimensional function and find its minimum? I can't get opt++ to work under windows. My function is not analytic so the package should have numerical gradient stuff built in. I had no idea this would be so hard to find! | |
I have "right" overloading working fine with: Vector Point::operator*( double P ) this would be called with MyPoint*2 and gives the results I would like. However, if I say: 2*MyPoint, it says I can't do that. Makes sense, but surely this can be done! I had trouble googling because I … | |
I have a class called Point. Point.h : [CODE] #ifndef POINT_H #define POINT_H #include "Vector.h" #include <iostream> class Point { friend ostream& operator<<(ostream& output, const Point& p) //must have global scope { output << "x: " << x << " y: " << y; return output; } [/CODE] The compiler … | |
I have a class Vector that needs to have a function that returns type Point, and a class Point that needs to have a function that returns type Vector. I was informed that I needed to use forward references, which I thought I had implemented as follows. I am still … | |
Is it possible to make a function with an unknown number of parameters without knowing ANY of them? ie. void Test(...) I know you could do void Test(va_alist) with varargs.h, doesn't make sense that this functionality has been removed does it? Thanks! Dave | |
Is there a way to interpolate between RGB values? I have a set of values that I want to map (linearly or otherwise) to colors from a color_min RGB triple to a color_max RGB triple. Since RGB is not "incrementable", how would I do this? Thanks, David |
The End.