Search Results

Showing results 1 to 40 of 65
Search took 0.01 seconds.
Search: Posts Made By: daviddoria ; Forum: C++ and child forums
Forum: C++ Nov 5th, 2009
Replies: 6
Solved: Triangle.
Views: 254
Posted By daviddoria
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++ Nov 5th, 2009
Replies: 6
Solved: Triangle.
Views: 254
Posted By daviddoria
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++ Sep 8th, 2009
Replies: 4
Views: 353
Posted By daviddoria
1) The undefined reference is because you are not linking to SaveData.cpp. Which IDE are you using (Visual studio, etc)?

2) 'retreive' should be spelled 'retrieve'.

3) you seem to still be...
Forum: C++ Sep 8th, 2009
Replies: 4
Views: 353
Posted By daviddoria
You have to create the array in the scope that you are going to use it! Probably the way to go here is have the retrieve() function accept a pointer to the array it will fill. Also, be careful not to...
Forum: C++ Sep 7th, 2009
Replies: 17
Views: 749
Posted By daviddoria
Which IDE are you using? (Visual studio, KDevelop, etc) I know in KDevelop the little command window is broken such that it just ignores cin type statements... seems very odd but I always have to...
Forum: C++ Sep 5th, 2009
Replies: 17
Views: 749
Posted By daviddoria
This seems to work fine for me...

#include <iostream>
#include <fstream>

using namespace std;

void skrivtilfil (string placering);
void laesfrafil ();
int main()
Forum: C++ Aug 9th, 2009
Replies: 5
Views: 300
Posted By daviddoria
I'm not sure what you're asking for help with, but you would want to overload << and >> so you could do something like this:


class A
{
int a,b;
};

int main()
{
Forum: C++ Jul 28th, 2009
Replies: 5
Views: 524
Posted By daviddoria
I always advocate using an std::vector when possible.. can you do this:

std::vector<int*> yourVar(8);
Forum: C++ Jul 18th, 2009
Replies: 1
Views: 216
Posted By daviddoria
VNL (part of VXL) has several multidimensional optimizers - http://vxl.sourceforge.net/
Forum: C++ Jul 14th, 2009
Replies: 4
Views: 297
Posted By daviddoria
What do you mean "return only one of the values"? A function can only return one value, and it looks like yours is... maybe you can give an example input, expected output, and current output?
Forum: C++ Jul 14th, 2009
Replies: 6
Views: 296
Posted By daviddoria
Please use code tags. You can find what you're looking for here:
http://www.learncpp.com/cpp-tutorial/93-overloading-the-io-operators/
Forum: C++ Jul 14th, 2009
Replies: 10
Solved: g++ warnings
Views: 704
Posted By daviddoria
I agree that it's generally a very bad idea - but if you DO have a good reason, compile with -Wno
Forum: C++ Jul 10th, 2009
Replies: 12
Views: 608
Posted By daviddoria
I think you need to display the plot in a separate thread. This operation will vary from OS to OS.
Forum: C++ Jul 9th, 2009
Replies: 3
Views: 526
Posted By daviddoria
I realize this is quite an odd/complicated problem, but can you reduce the amount of code necessary to produce it? Maybe you can play around and remove as many lines as possible and still produce the...
Forum: C++ Jul 6th, 2009
Replies: 21
Solved: Void Functions
Views: 601
Posted By daviddoria
oh oh, what was I thinking hahaha, you can "return" the values by reference! What you'll need to do is put a '&' here:

void getSales(double &sales, double salesTotal)


and the same with bonus:...
Forum: C++ Jul 6th, 2009
Replies: 21
Solved: Void Functions
Views: 601
Posted By daviddoria
Well that's not gona work unless you make everything global, which is a TERRIBLE idea. displayBonus() wont work for the same reason unless you call it from calcBonus(). I duno what to tell you - the...
Forum: C++ Jul 6th, 2009
Replies: 7
Views: 460
Posted By daviddoria
I don't understand, you are saying if it equals zero then "it is not a number"? Also, you can use this
std::string Zero = "0";
then if(Zero.compare(buf))

actually, i think compare() returns the...
Forum: C++ Jul 6th, 2009
Replies: 21
Solved: Void Functions
Views: 601
Posted By daviddoria
The getSales() function shouldn't be void - it needs to return the sales!
Forum: C++ Jul 5th, 2009
Replies: 8
Views: 375
Posted By daviddoria
Unfortunately I don't use windows so I can't try to help, but I have a hard time believing that error can't be produced in < 20 lines...
Forum: C++ Jul 5th, 2009
Replies: 8
Views: 375
Posted By daviddoria
Please use code tags and post the smallest fully compilable example that demonstrates the problem.
Forum: C++ Jul 2nd, 2009
Replies: 13
Solved: C++ arrays
Views: 533
Posted By daviddoria
You could use std::vector's of std::vector's - then you don't have to worry about new() and delete().
Forum: C++ Jul 1st, 2009
Replies: 6
Views: 427
Posted By daviddoria
the compare() function is just like "==" for std::strings.
Forum: C++ Jul 1st, 2009
Replies: 14
Views: 637
Posted By daviddoria
Surely the source code is not 18MB, try deleting the files that Ancient Dragon mentioned.
Forum: C++ Jun 23rd, 2009
Replies: 10
Views: 492
Posted By daviddoria
#include <iostream> is where you will find cout, etc.

namespaces are ways to group functions - for example, the cout, etc you are looking for are in the std namespace, so you have to call them...
Forum: C++ Jun 9th, 2009
Replies: 2
Views: 213
Posted By daviddoria
I believe the preferred method of reading all the lines in a file is this:


std::string line;

while(getline(fin, line))
{
//the current line is now in "line", handle it
}
Forum: C++ Jun 8th, 2009
Replies: 4
Views: 651
Posted By daviddoria
I believe what ithlep means for you to do is

MyFrame *mainFrame = new MyFrame(wxT("Test Harness"), wxSize(700, 600) );
if(mainFrame)
mainFrame->Show(true);
else
std::cout << "There was an...
Forum: C++ Jun 8th, 2009
Replies: 6
Views: 368
Posted By daviddoria
Please provide the smallest possible segment of code that isn't working, along with example input and actual output vs expected output.
Forum: C++ Jun 7th, 2009
Replies: 4
Views: 749
Posted By daviddoria
Where is CString declared? Is it a visual studio thing? Because CString is definitely not a standard c++ thing.
Forum: C++ Jun 2nd, 2009
Replies: 6
Views: 741
Posted By daviddoria
You could also use an std::vector of your struct to avoid almost every problem that will come up.

Dave
Forum: C++ May 31st, 2009
Replies: 2
Views: 308
Posted By daviddoria
The first compiler error I get is that your struct data_to_pass_st isn't defined anywhere. Also, I don't know where common.h is - maybe it is a windows thing?

Dave
Forum: C++ May 28th, 2009
Replies: 9
Views: 254
Posted By daviddoria
You don't have a semicolon after num++. There is no reason that I should have to compile your code to find out what the compiler errors are... post the compilers output next time. Also, there is not...
Forum: C++ May 28th, 2009
Replies: 9
Views: 254
Posted By daviddoria
Forum: C++ May 17th, 2009
Replies: 2
Views: 463
Posted By daviddoria
Here is a good explanation of left shift (<<) and right shift (>>)
http://irc.essex.ac.uk/www.iota-six.co.uk/c/e5_bitwise_shift_operators.asp

Dave
Forum: C++ May 12th, 2009
Replies: 13
Solved: Sorting vectors
Views: 718
Posted By daviddoria
Here is what you are trying to do:
http://answers.yahoo.com/question/index?qid=20080422195554AAANJgl
Forum: C++ Apr 18th, 2009
Replies: 33
Views: 2,003
Posted By daviddoria
What platform are you on (linux or windows)?
Forum: C++ Apr 18th, 2009
Replies: 33
Views: 2,003
Posted By daviddoria
Is this an open source thing that we can download and try to compile? If so, please post a link.

Dave
Forum: C++ Apr 6th, 2009
Replies: 10
Views: 1,955
Posted By daviddoria
You can try VIL (part of VXL)
http://public.kitware.com/vxl/doc/development/
Forum: C++ Mar 23rd, 2009
Replies: 6
Views: 242
Posted By daviddoria
Ok so Puzzle is a public member variable of Sudoku. To access it in main, you have to first create an instance of your Sudoku class


Sudoku MySudoku;

Then you can access the Puzzle variable...
Forum: C++ Mar 23rd, 2009
Replies: 6
Views: 242
Posted By daviddoria
Is puzzle a member of a class? Or just a global variable that was created in the .h file? Can you post your .h file?
Forum: C++ Mar 23rd, 2009
Replies: 6
Views: 242
Posted By daviddoria
You say

if (Puzzle[ptx]...


but you haven't defined Puzzle anywhere!
Showing results 1 to 40 of 65

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC