Forum: C++ Oct 14th, 2009 |
| Replies: 6 Views: 255 Based on what you needed it would make sense for the C++ app to listen (be the server) and PHP to send the data to the server (client) |
Forum: C++ Oct 14th, 2009 |
| Replies: 6 Views: 255 http://php.net/sockets
For C++ you might want to look around for forums, there's bound to be a link to a good one. If not, just google C++ sockets there is a veritable shit-ton |
Forum: C++ Oct 14th, 2009 |
| Replies: 6 Views: 255 There are a couple of ways to do it that pretty easy. If you're using the socket approach you can just have PHP open a client socket and send data to the C++ app. The other way is just to have C++... |
Forum: C++ Oct 14th, 2009 |
| Replies: 2 Views: 148 Wow, it's your second post and you still haven't read the rules. Bravo to you sir, that takes skill. |
Forum: C++ Oct 14th, 2009 |
| Replies: 2 Views: 170 Try not to spoon-feed him homework help considering he hasn't posted any attempts. |
Forum: C++ Oct 9th, 2009 |
| Replies: 10 Views: 364 I was using num as an example. Forget about num, you're using num for your menu. You want to do it for each of your operations like this
else if (num == 1)
{
int rad = -1;
double pie =... |
Forum: C++ Oct 9th, 2009 |
| Replies: 1 Views: 265 |
Forum: C++ Oct 9th, 2009 |
| Replies: 10 Views: 364 Well here
if (num < 1 || num > 4)
You're already checking if user input input is negative for the menu so just use that logic when you get input for the user's other values, for example
if (base <... |
Forum: C++ Oct 8th, 2009 |
| Replies: 9 Views: 860 What? Are you mentally retarded?[/QUOTE]
s/good/accurate/ |
Forum: C++ Oct 8th, 2009 |
| Replies: 9 Views: 860 Well vectors are an expandable data structure whereas arrays are static. Once you define the size of an array it pretty much stays there (yeah, there are ways to increase them but not easily).... |
Forum: C++ Sep 24th, 2009 |
| Replies: 2 Views: 227 Just do it inside the constructor, that's what it is there for. |
Forum: C++ Sep 23rd, 2009 |
| Replies: 2 Views: 332 _ is usually associated with gettext with deals with text localization. |
Forum: C++ Sep 17th, 2009 |
| Replies: 9 Views: 360 Then you move onto the next step of debugging. Remove stuff you just added until it stops breaking. Then re-add the code and figure out why it broke. Really, these are basic debugging steps to... |
Forum: C++ Sep 17th, 2009 |
| Replies: 9 Views: 360 I was using couts as an example, the method you want to use to display the message is up to you |
Forum: C++ Sep 17th, 2009 |
| Replies: 9 Views: 360 Try actually putting something in your catch statement. And if you're not getting anything there then take the old-fashioned approach and just put asserts/couts along your code to see where it dies... |
Forum: C++ Sep 15th, 2009 |
| Replies: 3 Views: 241 You might want to try compiling and working your way through the errors. These two lines will definitely cause issues.
// call function calcAverage
int calcAverage(int score1, int score2, int... |
Forum: C++ Sep 15th, 2009 |
| Replies: 8 Views: 420 My guess is that it's not being passed by reference :) |
Forum: C++ Sep 15th, 2009 |
| Replies: 8 Views: 420 You create your list as list <char> but your function prototype never defines a template type, you just have list. So you could either make the function templated or you can always assume <char>
... |
Forum: C++ Sep 9th, 2009 |
| Replies: 14 Views: 492 You would use the function just like you would inside another function. With the example code afunction isn't defined (there is no prototype.) You could do something like this
void afunction(); //... |
Forum: C++ Aug 24th, 2009 |
| Replies: 13 Views: 387 '"string with"' is invalid, '' are used for chars, "" are for strings.
"\"string with\"" is that string |
Forum: C++ Aug 24th, 2009 |
| Replies: 13 Views: 387 somestring = "this is a \"string with \" quotes"; |
Forum: C++ Aug 12th, 2009 |
| Replies: 1 Views: 310 You might want to see your other post where you copy/paste homework questions for my answer. |
Forum: C++ Aug 12th, 2009 |
| Replies: 1 Views: 225 I'll help you first by saying this isn't your first post, it's your 11th, you should know how to use code tags by now. You should also know that we don't give help to those who don't show effort. |
Forum: C++ Aug 12th, 2009 |
| Replies: 3 Views: 232 I hate when I brain changes words in sentences without telling me, in my defense I use the word method for class methods only and functions for globally namespaced functions |
Forum: C++ Aug 12th, 2009 |
| Replies: 3 Views: 232 A) Use google or Daniweb Search
B) Say you have a function that you want to work on both strings and chars for example I have a function to convert a decimal number to a binary string (Hi ->... |
Forum: C++ Aug 12th, 2009 |
| Replies: 3 Views: 427 The same exact way you did with Person except replace Person with Patient
class Patient : public Person {};
class StudentPatient : public Patient {};
... |
Forum: C++ Aug 6th, 2009 |
| Replies: 2 Views: 208 I'm most familiar with Trac (http://trac.edgewall.org/) which is web (python) based and haven't really run across any SVN source/bug tracking system that is as user-friendly. Whatever you do, stay... |
Forum: C++ Aug 5th, 2009 |
| Replies: 6 Views: 424 That particular PDF doesn't contain everything but it's a good introduction to Magick++ and if you take a gander at the links at the end you'll get pretty much everything you need to know to do image... |
Forum: C++ Aug 5th, 2009 |
| Replies: 6 Views: 424 http://www.imagemagick.org/Magick++/tutorial/Magick++_tutorial.pdf |
Forum: C++ Jul 24th, 2009 |
| Replies: 4 Views: 281 Elevators shouldn't be a child of Building, they aren't buildings. You could make it public instead of going about all the hackery or adding getFloors/setFloors methods. |
Forum: C++ Jul 24th, 2009 |
| Replies: 4 Views: 281 They can't. A private member can only be access from the direct parent. Even child classes can't get access to it, that's what protected is for.
http://www.parashift.com/c++-faq-lite/friends.html |
Forum: C++ Jul 22nd, 2009 |
| Replies: 5 Views: 256 Might want to clarify a do/while otherwise nothing will happen :) |
Forum: C++ Jul 22nd, 2009 |
| Replies: 3 Views: 632 Cool, how's that working out for you?
http://www.daniweb.com/forums/announcement8-2.html |
Forum: C++ Jul 13th, 2009 |
| Replies: 2 Views: 225 It should also be noted that you can't do this outside of the ComplexNum class
result.real = cNum1.real - cNum2.real;
result.img = cNum1.img - cNum2.img;
You declared real and img to be private... |
Forum: C++ Jul 13th, 2009 |
| Replies: 2 Views: 225 What's the point of using cNum1 and cNum2, you already have the variables first and second to use.
You can do the same thing for both functions
ComplexNum ComplexCalc::subComplex( ComplexNum... |
Forum: C++ Jul 10th, 2009 |
| Replies: 5 Views: 241 At first I thought initializations of constructor/copy constructor but it looks more just like function prototypes. |
Forum: C++ Jul 10th, 2009 |
| Replies: 5 Views: 241 Actually, it is a normal vector declaration. std::vectors are a templated class. To instantiate a vector you pass a type to the template. Might want to read up on templates. In this case the code... |
Forum: C++ Jun 27th, 2009 |
| Replies: 3 Views: 347 That's not an error, it's a warning. And C++ std::string::length() returns an unsigned int. You're using an int for your counter in your loop so the comparison j < item.length() is comparing a signed... |
Forum: C++ Jun 24th, 2009 |
| Replies: 14 Views: 477 Also, your last if statement in your snippet will always be true, you only used one = |
Forum: C++ Jun 24th, 2009 |
| Replies: 14 Views: 477 What the heck? Why did you do this?
const double pi = 3.1415926535;
const double Pi = 3.1415926535;
const double pI = 3.1415926535;
const double PI = 3.1415926535; What were you trying to... |