Search Results

Showing results 1 to 37 of 37
Search took 0.03 seconds.
Search: Posts Made By: ShawnCplus ; Forum: C++ and child forums
Forum: C++ Oct 14th, 2009
Replies: 6
Solved: php to c++?
Views: 252
Posted By ShawnCplus
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
Solved: php to c++?
Views: 252
Posted By ShawnCplus
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
Solved: php to c++?
Views: 252
Posted By ShawnCplus
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 9th, 2009
Replies: 10
Views: 362
Posted By ShawnCplus
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: 10
Views: 362
Posted By ShawnCplus
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++ Sep 9th, 2009
Replies: 14
Views: 492
Posted By ShawnCplus
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: 385
Posted By ShawnCplus
'"string with"' is invalid, '' are used for chars, "" are for strings.
"\"string with\"" is that string
Forum: C++ Aug 24th, 2009
Replies: 13
Views: 385
Posted By ShawnCplus
somestring = "this is a \"string with \" quotes";
Forum: C++ Jun 22nd, 2009
Replies: 17
Views: 1,398
Posted By ShawnCplus
Well it'd be enter operation, enter first number, enter second number -> switch(operation) { calculate answer } -> output answer -> done

EDIT: This is my 1000th post, wooo!
Forum: C++ Jun 22nd, 2009
Replies: 17
Views: 1,398
Posted By ShawnCplus
Ok, then yeah, follow the instructions. And you only have to worry about dividing BY zero, it doesn't matter if numerator is zero, only check the denominator (secondNum in this case)
Forum: C++ Jun 22nd, 2009
Replies: 17
Views: 1,398
Posted By ShawnCplus
why would you have to swap for subtraction? Also, you're not checking to make sure that you're not dividing by zero in your division section
Forum: C++ Jun 22nd, 2009
Replies: 17
Views: 1,398
Posted By ShawnCplus
As a side note, do you notice that you have a lot of repetitive code? That usually means it can be taken out and put in one place. Everything inside the if/else blocks does exactly the same thing...
Forum: C++ Jun 22nd, 2009
Replies: 17
Views: 1,398
Posted By ShawnCplus
Ya can't just put braces in random spots and expect it to work :)

//Ch6AppE08.cpp
//Displays the answer to arithmetic problems
//Created/revised by Greg Schader on 6/22/2009

#include...
Forum: C++ Jun 22nd, 2009
Replies: 17
Views: 1,398
Posted By ShawnCplus
When you fix something don't just say it didn't work and wait for another answer, post the updated code
Forum: C++ Jun 22nd, 2009
Replies: 17
Views: 1,398
Posted By ShawnCplus
Don't forget the braces around your inner if and else statements, take a look in your book on why to do this (if it explains it)
Forum: C++ Jun 22nd, 2009
Replies: 5
Solved: Is it possible?
Views: 280
Posted By ShawnCplus
ECMA-48 SGR sequences are used for (somewhat) portable termal color. http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
Forum: C++ May 8th, 2009
Replies: 24
Solved: round
Views: 1,339
Posted By ShawnCplus
With the math.h(or cmath someone correct me on this) header you can use the floor and ceil functions if I remember correctly to round down and round up respectively.
Forum: C++ May 5th, 2009
Replies: 8
Views: 311
Posted By ShawnCplus
Yeah, that's a bit easier to follow than what I said but essentially the same :)
Forum: C++ May 5th, 2009
Replies: 8
Views: 311
Posted By ShawnCplus
It's to solve the diamond inheritance problem where you have a base class, then 2 child classes then a 4th class that inherits from both of the previous classes. If the base class declares a function...
Forum: C++ Apr 28th, 2009
Replies: 11
Views: 513
Posted By ShawnCplus
That looks suspiciously like a homework question. Perhaps you should give a shot at coding it a bit yourself before we give you a hand.
Forum: C++ Mar 16th, 2009
Replies: 4
Views: 549
Posted By ShawnCplus
Do you understand what these lines do?
*(boardSkin +(row * columns) + column)
You're setting a memory address to a value, that above line is the same thing as saying...
Forum: C++ Mar 9th, 2009
Replies: 4
Views: 701
Posted By ShawnCplus
C++ does not have anonymous functions. However, C++0x standard does using the following syntax (using a std::for_each as an example)

std::map<int, int> someMap;
// ... ......
Forum: C++ Feb 3rd, 2009
Replies: 3
Views: 247
Posted By ShawnCplus
It's also not doubling in the variable, you're just outputing the variable twice. You have a cout inside the if, and a cout before the return.
Forum: C++ Dec 27th, 2007
Replies: 30
Views: 2,947
Posted By ShawnCplus
Nope, people that use void main are doomed to be forsaken by the appropriate deity, if the case arises that they do not believe in one then they will be forced to watch nothing but reruns of Who's...
Forum: C++ Dec 27th, 2007
Replies: 30
Views: 2,947
Posted By ShawnCplus
He was referring to Salem's avatar which states that void main'ers are doomed. void main(), main should always return an int ie., int main()
Forum: C++ Dec 21st, 2007
Replies: 18
Solved: beginners
Views: 3,836
Posted By ShawnCplus
int main1() should be int main() but as the poster above me stated that particular include file is not necessary. Also, #include "iostream" should be #include <iostream> Quotes are generally used to...
Forum: C++ Oct 29th, 2007
Replies: 2
Solved: operator-
Views: 638
Posted By ShawnCplus
Well, for one you are obfuscating your code to an extreme extent by not giving meaningful variable names. friend zz operator-(zz z);
Secondly, the - operator is a binary operator. It accepts two...
Forum: C++ Sep 18th, 2007
Replies: 5
Solved: need help
Views: 1,004
Posted By ShawnCplus
I guess it's better than "Please help this was due yesterday!"
Forum: C++ Sep 18th, 2007
Replies: 5
Solved: need help
Views: 1,004
Posted By ShawnCplus
In the constructor you are trying to initialize the Day, Month and Year variables to variables which do not exist. In that scope theday, themonth and theyear are not accessible. To fix that you would...
Forum: C++ Sep 17th, 2007
Replies: 4
Views: 1,058
Posted By ShawnCplus
If you look at line 137 it calles the MessageBox function which takes the arguments
MessageBox(<message to show>, <title>, <buttons to show>, <icon to show>)
Forum: C++ Aug 4th, 2007
Replies: 2
Solved: MUD help?
Views: 1,348
Posted By ShawnCplus
Coding sockets aren't just a one-post length thing. Go download SocketMUD which is a C/C++ barebones MUD codebase. It has pretty much nothing but the sockets so you could see how they work that way....
Forum: C++ Aug 2nd, 2007
Replies: 67
Views: 6,153
Posted By ShawnCplus
That line keeps overwriting the values. In the end it is left with only the last values
Forum: C++ Jul 5th, 2007
Replies: 67
Views: 6,153
Posted By ShawnCplus
You forgot brackets for the while loop so it's only doing the first if-check


while(condition)
{
//do this stuff
}
Forum: C++ Jun 21st, 2007
Replies: 19
Solved: Easter Sunday
Views: 2,448
Posted By ShawnCplus
Well, you put the if statement in there but you didn't really do anything. Look up if-check syntax in your book it should be:

if (var relation value)
{
statement;
}

Example:

if...
Forum: C++ Jun 21st, 2007
Replies: 19
Solved: Easter Sunday
Views: 2,448
Posted By ShawnCplus
Yes it does but you are trying to do the calculations before you have gotten any input. It is trying to do the math on a number that doesn't exist.
Forum: C++ Jun 21st, 2007
Replies: 19
Solved: Easter Sunday
Views: 2,448
Posted By ShawnCplus
Well firstly you are trying to do math with x before it actually has a variable so once it gets the others (a, b, c, d, e, sun) aren't actually giving the correct number
Forum: C++ Jun 20th, 2007
Replies: 19
Solved: Easter Sunday
Views: 2,448
Posted By ShawnCplus
You are trying to output the value of x before actually getting the value. IE. You are using cout<<x<< endl; before cin>> x;
Showing results 1 to 37 of 37

 


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

©2003 - 2009 DaniWeb® LLC