Forum: C++ 1 Day Ago |
| Replies: 1 Views: 97 Say you have a class that has members
private:
double a,b,c,d,e,f,g,h,i;
You can make an accessor like:
double operator[](int index)
{ |
Forum: C++ 11 Days Ago |
| Replies: 4 Views: 139 Jas, but won't it still crash evaluating the second part of the conditional?
Dave |
Forum: C++ 11 Days Ago |
| Replies: 4 Views: 139 If I have the following setup:
Point* MyPoint = Object->GetMyPoint();
if(MyPoint->GetValue() != 2)
do something;
else
do something else; |
Forum: C++ 15 Days Ago |
| Replies: 4 Views: 180 From that algorithm you gave I don't understand how you are supposed to get more than one factor?
Maybe this will be a good starting point for you - it just gets the smallest factor (besides 1)... |
Forum: C++ 15 Days Ago |
| Replies: 3 Views: 156 Is this what you are looking for?
#include <iostream>
#include <string>
int main()
{
const char NONWORD[] = "\n"; |
Forum: C++ 15 Days Ago |
| Replies: 6 Views: 195 Here you have declared the variables, but then output just constant expressions...
I'd suggest googling for "basic c++" and trying some of the simple examples you find until you get familiar with... |
Forum: C++ 15 Days Ago |
| Replies: 3 Views: 156 I don't understand why you would want to remove stl features? They make things MUCH easier... |
Forum: C++ 15 Days Ago |
| Replies: 4 Views: 180 You need to give us more of a feeling that you have really tried. Did your code produce errors? Or incorrect results? Why don't you try some simple cases like the number '4'. You should expect to see... |
Forum: C++ 15 Days Ago |
| Replies: 3 Views: 94 First of all, you should #include <iostream> instead of #include <iostream.h>. This is the "new" c++ way to do it.
Second, you have to #include <cstring> to use strcpy.
Third, you have not... |
Forum: C++ 15 Days Ago |
| Replies: 2 Views: 126 I don't understand the problem...
int NumberOfPositiveRoots(root1, root2)
{
int counter = 0;
if (root1 >= 0)
{
counter++;
}
if (root2 >= 0) |
Forum: C++ 15 Days Ago |
| Replies: 6 Views: 195 What you have there is simply a hard coded triangle. You need to write the code to setup the triangle's height and width. Give it a shot and post your problem once you try it. |
Forum: C++ 27 Days Ago |
| Replies: 5 Views: 151 Please explain exactly what you need. What operating system are you using? |
Forum: Windows Software 30 Days Ago |
| Replies: 0 Views: 212 Is there a "correct" way to draw a line betwee the header and body of a document in word 2007? I've been using a Shapes->Lines line, but it seems silly because there is no way to center it, etc.
... |
Forum: C++ Oct 17th, 2009 |
| Replies: 3 Views: 240 I had to instantiate the constructor by adding this to the instances.inc file:
template Graph<int,int,int>::Graph(int, int, void (*)(char *));
Does anyone understand why / know if the... |
Forum: C++ Oct 16th, 2009 |
| Replies: 3 Views: 240 With this code:
http://www.rpi.edu/~doriad/Daniweb/maxflow/
If I run
g++ Example.cpp graph.cpp
with g++ 3.3, everything works fine. However if I run the same command with g++ 4.4, I get... |
Forum: Windows NT / 2000 / XP Oct 14th, 2009 |
| Replies: 3 Views: 299 caperjack - that removes the big calendar button, but it doesn't remove calendar from the "Favorite Folders" list. |
Forum: Windows NT / 2000 / XP Oct 14th, 2009 |
| Replies: 3 Views: 299 With normal folders, you can right click them and say "Remove from favorite folders, as per here: http://office.microsoft.com/en-us/outlook/HA011176721033.aspx
However, Calendar and Contacts don't... |
Forum: C++ Oct 12th, 2009 |
| Replies: 11 Views: 327 Interesting - can anyone else confirm?
I am using:
gcc version 4.4.1 20090725 (Red Hat 4.4.1-2) (GCC) |
Forum: C++ Oct 12th, 2009 |
| Replies: 4 Views: 195 Hm I tried that - didn't seem to work. Here is a super simplified version that produces the same error:
http://www.rpi.edu/~doriad/Daniweb/octree/
I still think the problem is simply that they... |
Forum: C++ Oct 12th, 2009 |
| Replies: 11 Views: 327 I'm still getting the same error. Can someone try these files:
http://www.rpi.edu/~doriad/Daniweb/maxflow/
with
g++ Example.cpp graph.cpp |
Forum: C++ Oct 12th, 2009 |
| Replies: 11 Views: 327 I dont think so ...
The constructor is actually:
Graph(int node_num_max, int edge_num_max, void (*err_function)(char *) = NULL);
which is an optional parameter, no? Hence it should be fine... |
Forum: C++ Oct 12th, 2009 |
| Replies: 11 Views: 327 I am doing that:
[doriad@davedesktop test]$ g++ Example.cpp graph.cpp
/tmp/ccHbyqCi.o: In function `main':
Example.cpp:(.text+0x38): undefined reference to `Graph<int, int, int>::Graph(int, int,... |
Forum: C++ Oct 12th, 2009 |
| Replies: 4 Views: 195 |
Forum: C++ Oct 12th, 2009 |
| Replies: 11 Views: 327 Does any one have any clues for me?
Dave |
Forum: Windows Software Oct 11th, 2009 |
| Replies: 2 Views: 345 Ah great - I never knew about that! |
Forum: HTML and CSS Oct 11th, 2009 |
| Replies: 5 Views: 343 Great - I guess the problem was mostly with what was contained inside the content-wrap. I didn't end up "clearing" any of the div's, but it seems to be working fine.
Thanks! |
Forum: HTML and CSS Oct 11th, 2009 |
| Replies: 7 Views: 440 |
Forum: HTML and CSS Oct 10th, 2009 |
| Replies: 7 Views: 440 I agree about the layout. However if I let the page expand to the screen width then the images specified in pixels will look too big/small unless the resolution is the same as my design resolution,... |
Forum: HTML and CSS Oct 9th, 2009 |
| Replies: 7 Views: 440 Is there anyway to get images to be the "correct" size - i.e. fit the width of the text?
This is what currently happens:
http://engineeringnotes.net/personal/pictures.shtml
Thanks,
Dave |
Forum: HTML and CSS Oct 9th, 2009 |
| Replies: 5 Views: 343 I see, thanks. However, I have most of the code in a header.shtml file so I can do this:
<div id="wrap">
<!--#include file="header.shtml" -->
<div id="main">
Home page
</div>... |
Forum: HTML and CSS Oct 9th, 2009 |
| Replies: 5 Views: 343 I'm still very new to css, so I'm sure this is just some really silly thing:
http://engineeringnotes.net/personal/
Does anyone know why the text is hanging off the left side of the page (on the... |
Forum: Windows Software Oct 9th, 2009 |
| Replies: 2 Views: 345 I have a folder A with files 001.jpg, 002.jpg, etc
I also have a folder B with different files but with the same names; 001.jpg, 002.jpg, etc
I want to put all the files in the same directory -... |
Forum: C++ Oct 9th, 2009 |
| Replies: 4 Views: 195 I am looking at some open source code and I am a bit confused. There is an Allocator class:
class Allocator{
Then in another class, they have:
class Octree{
public:
static... |
Forum: C++ Oct 9th, 2009 |
| Replies: 11 Views: 327 Here is a simplified version that produces the error:
graph.h
#include <string.h>
template <typename captype, typename tcaptype, typename flowtype> class Graph
{ |
Forum: C++ Oct 8th, 2009 |
| Replies: 11 Views: 327 I am trying to compile some code (Example.cpp from here: http://www.rpi.edu/~doriad/Daniweb/maxflow/). I am getting
Example.cpp:(.text+0x38): undefined reference to `Graph<int, int,... |
Forum: C++ Sep 20th, 2009 |
| Replies: 6 Views: 580 Please show us the code that you've come up with so far and we can help guide you. |
Forum: C++ Sep 18th, 2009 |
| Replies: 8 Views: 337 The thing is, I didn't change anything except the debugger and all is well, so I don't think the this pointer could be invalid and it work now?
I have to use the this pointer because of this:... |
Forum: C++ Sep 18th, 2009 |
| Replies: 8 Views: 337 Here is the next line:
std::set<unsigned int>::iterator it;
it = this->SubmeshVertexSet.find(MeshOriginIndex);
SubmeshVertexSet is a member variable:
private:
std::set<unsigned int>... |
Forum: C++ Sep 17th, 2009 |
| Replies: 8 Views: 337 I guess it was a gdb bug? I compiled the latest svn and it gets past that line now with no problems. |
Forum: C++ Sep 17th, 2009 |
| Replies: 8 Views: 337 Unfortunately this is embedded way way way in a huge project. I was trying to see if anyone could offer an "of course I can't be sure, but you could try XYZ".
Dave |