Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
94% Quality Score
Upvotes Received
20
Posts with Upvotes
18
Upvoting Members
13
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
5 Commented Posts
0 Endorsements
Ranked #630
~70.9K People Reached
Favorite Forums
Favorite Tags

78 Posted Topics

Member Avatar for adoleh

You're doing the calculations before you're getting the number, and since num will be 0 at that point, tens digit and ones digit will always equal zero, no matter what. You need to take in your number THEN do the calculations for tens digit and ones digit.

Member Avatar for emsmary
0
16K
Member Avatar for AmerJamil

You may want to start with a loop, to take in the digits. Make sure you have a way to ensure that, when added, if a digit exceeds 10, it gets added to the higher digit. Also, remember that arrays begin with [0] and not [1], when you're programming the …

Member Avatar for JamesCherrill
0
1K
Member Avatar for TheFearful

Your array is not two-dimensional. I also suggest using a variable for input as opposed to just defining every possible outcome. You're setting yourself for one tedious and hard to follow jumble of code. An example: [code] unsigned short x,y; cin >> x >> y; myArray[x][y]= 'X' [/code] This takes …

Member Avatar for マーズ maazu
0
3K
Member Avatar for ankit.4aug

I smell homework. Read up in your reference book on implementation of pointers.

Member Avatar for Suchita_1
0
141
Member Avatar for jonspeidel

[QUOTE=jonspeidel;1688769] [CODE]#include<iostream> #include<windows.h> #include<conio.h> #include<strings.h> using namespace std; int main(); void repeat(); void worked(); string s1; string s2; string s3; int main() { repeat(); } void repeat() { string s3="n"; cout << "Would you like to perform another operation?\n"; cin >> s3; if((s3=="Y" || "y")) { worked(); } if((s3=="N" || …

Member Avatar for WaltP
0
252
Member Avatar for jpico

[code]if (conversion !=1|| conversion !=2|| conversion !=3|| conversion !=4|| conversion !=5|| conversion !=6)[/code] Can be changed to [code]else[/code] Since the above is implied through the preceding code. Also be careful with your brackets. Line 73 is the end of your do loop and line 76 is the end of int …

Member Avatar for Red Goose
0
156
Member Avatar for ktsangop
Member Avatar for ktsangop
1
2K
Member Avatar for phorce

[QUOTE=jackmaverick1;1689724]I think there's a char code that you can use. (like /20?)[/QUOTE] Blank space IS a char. [code] #include <iostream> using std::cout; int main() { char c = ' '; cout <<"Space" << c << "is" <<c <<"a"<<c<<"Character."; cout <<"\nAscii code = " << int(c); return 0; } [/code] Note …

Member Avatar for Red Goose
0
107
Member Avatar for alarifth

[code]Person::Person(string first = "", string second = "")[/code] Out of curiosity, what are you tying to accomplish with your parameters?

Member Avatar for mzimmers
0
10K
Member Avatar for slygoth

Just open an output stream and save them to a text file, you're already halfway there.

Member Avatar for slygoth
0
107
Member Avatar for DeusManP0W

1. You're not using a char variable, you're using an integer variable. Integers are strictly numerical. 2. Character variables can only hold 1 character. This is due to size limitation of the variable. You will need an array characters to accept input with more than one character. If this sounds …

Member Avatar for DeusManP0W
0
213
Member Avatar for kkreisler

You're asking for input of a character but your variable is an integer, which can only be numerical. The problem your seeing is common to mis-matched variable types. A for loop is also the incorrect type of loop for this particular function. The loop outlined above would serve your purpose …

Member Avatar for kkreisler
0
150
Member Avatar for RisTar

You have your array declare globally, I'd change that. Also, try declaring the range of the array inside your function. I'd imagine by the nature of multidimensional arrays your compiler will want that specified. Example: [code]myfunc(int array[0][5]) //change the '0' to '5'.[/code]

Member Avatar for RisTar
0
166
Member Avatar for shizu

[QUOTE=shizu;1494701]Hi luce.. I try your code already.. once compile I get error message like below show.. ****************************************************************** error C2065: 'Image' : undeclared identifier error C2146: syntax error : missing ';' before identifier 'image' error C2065: 'image' : undeclared identifier error C2065: 'GetEncoderClsid' : undeclared identifier error C2228: left of '.Save' …

Member Avatar for mrnutty
0
3K
Member Avatar for Mr. K

[url=http://advancedcppwithexamples.blogspot.com/2009/08/measuring-elapsed-time-in-c-using_21.html]QueryPerformanceCounter[/url] 20 pixel per second = 1ms x 50 per pixel. Perform the check via subtraction and if the time difference exceeds 50, move one pixel. Of course, you'll then need to reset the "clock" so to speak. Alternatively, you could just grab the time via Clock(), that measures the …

Member Avatar for Mr. K
0
193
Member Avatar for valestrom

You're skipping your if loops: [code] if (gamechoices == "Attack" || gamechoices == "fight" || gamechoices == "kill");[/code] The semicolon ";" at the end terminates the if statement. You need to place anything that will be executed within your if loops within brackets "{ }". It's a common mistake since …

Member Avatar for valestrom
0
301
Member Avatar for flyboy567

1.Make sure everything is kept as a character; use some denotation as terminator so you can have multi-digit numbers without much difficulty. 2.Convert these chars to their ASCII equivalent integer. If the ASCII value of the char is between 0-9, give it precedence over any non-integer character. A simple boolean …

Member Avatar for mike_2000_17
0
158
Member Avatar for FrancisLazo

Why the use of strings? Boolean statements would work just as well(better even): [code] bool seat[200]; [/code] And then... [code] if (seat[input] == 1) cout << "Seat Number" << input << "is reserved. Please choose another."; else seat[input] = 1 [/code] And there you go. Your 500 hundred line case …

Member Avatar for Red Goose
0
227
Member Avatar for caltech

[QUOTE=Moschops;1486526]Your divides function takes two int objects as parameters, and returns an int. Accordingly, you must call it like this: [CODE]returnedInt = divides (someInt, someOtherInt);[/CODE] where [B]returnedInt[/B], [B]someInt[/B] and [B]someOtherInt[/B] are all of type [B]int[/B].[/QUOTE] Or, he could use an if statement to check the returned value like so: [code] …

Member Avatar for caltech
0
126
Member Avatar for mrgreen

Why use a queue at all? The queue is only gonna return the same thing as your string in the first place. Remember the nature of a stack. A stack is somewhat unfair and believes that the last person to come should be the first to go. Think of a …

Member Avatar for biljith
0
177
Member Avatar for Stefano Mtangoo

[QUOTE=Fbody;1484874]So are you saying that you can generate closed-source code, and use a license of your choosing for it, so long as you have an appropriate notice concerning, and provide access to, the MySQL License and Source in compliance with the GPL?[/QUOTE] Read more about the GPL [url=http://www.gnu.org/philosophy/selling.html]here[/url].

Member Avatar for Stefano Mtangoo
0
451
Member Avatar for c+-

Just to clarify, the prototype is what tells the compiler that the function exists, so if another function calls that function before it is actually defined, the compiler knows it exists and doesn't need to throw an error at you. A class declaration (as you've shown), is the same thing. …

Member Avatar for template<>
0
512
Member Avatar for schrope

[QUOTE=schrope;1481422]that is what i thought but it is not working-- i rewrote the last line of code digit_two+=7%10; //add digit_two to 7 and mod 10 digit_three+=7%10; //add digit_three to 7 and mod 10 digit_four+=7%10; //add digit_four to 7 and mod 10 cout <<"Encrypted digits:" << digit_three digit_four digit_one digit_ two …

Member Avatar for Crutoy
0
183
Member Avatar for FriXionX

[QUOTE=FriXionX;1478480]Gah, so confusing. I'm gonna learn a bit more, then come back to this, because i dont really understand at the moment. Thanks for the help anyway, ill refer back to this later.[/QUOTE] You should probably find a textbook or some sort and learn from that. If you follow it …

Member Avatar for Kanoisa
0
245
Member Avatar for jonspeidel

You're not looping because s2 doesn't equal anything. Don't use goto, you have the right idea with a loop, you just need to fix your execution. Either: 1. Ask for the input of s2 before ending your loop. 2. Check s1 for a specific input and if it equals that …

Member Avatar for 1ML
0
399
Member Avatar for surferxo3

Hint: You can check the validity of the board by the sum of all the numbers within a given column or row.

Member Avatar for surferxo3
0
145
Member Avatar for kra9853

To see every available character, compile and run this code, if you can make the "cent" symbol in a char or string, it'll be there: [code] #include <iostream> #include <iomanip> using namespace std; int main() { char c; for (int x = 0; x <= 255; x++ ) { c …

Member Avatar for mike_2000_17
0
809
Member Avatar for Sundayy

Your if statements aren't doing anything to begin with. You may want to carefully reexamine if statement implementation.

Member Avatar for peter_budo
0
446
Member Avatar for Juan-Ellyn
Member Avatar for Juan-Ellyn
0
174
Member Avatar for lashatt2

Well, this isn't C++. Also, I don't fully understand the question. You simply specify that Column before you perform the action. There's not much else to it.

Member Avatar for smantscheff
0
114
Member Avatar for i4ba1

Well, c++ will be just as complicated as Java and I believe Adobe Air will require you to use Java anyways,

Member Avatar for i4ba1
0
173
Member Avatar for kartikkp

This is an error you receive when your compiler can't find the entry point to your code. Your main function cannot be inside a class. How will you access it inside a class? What will call it? You need your main function to be immediately accessible so your program can …

Member Avatar for jonsca
0
113
Member Avatar for chamnab
Member Avatar for Red Goose
0
139
Member Avatar for Transcendent

You've followed the flow chart well, though you have a typo in your bProd function. Hint: There's a difference between unary and binary operators. Hint2: Is everything in your code being put to use?

Member Avatar for mike_2000_17
0
458
Member Avatar for c++coder

Please use the CODE tags when posting code, it makes it much easier to read. Also, please post your whole code.

Member Avatar for c++coder
0
1K
Member Avatar for lgonzo

Your positioning is the reason. [code] do { cout << "do you want to play again? (y/n)" << endl; cin >> ans; if (ans == 'n') { cout << "Thank you for playing...... press <enter> key to exit"<< endl; cin.get(); found = true; } if ( ans == 'y') { …

Member Avatar for lgonzo
0
89
Member Avatar for reemhatim

Most likely you're exceeding the limitation of the variable, so at some point, it's counting over to 0, and then multiplies from 0 there onward. Not much can be done about that, except perhaps storing the number inside a container or something of the like. You're not going to find …

Member Avatar for Momerath
0
86
Member Avatar for TheAgent1982
Member Avatar for biancaW

Yes, any integer-like variable type: [code] short isValid = 1; [/code] 0 is the same as false, and any other value is equal to true. One such instance in which this would be a useful tactic is error handling, where false would mean no error occurred, and any true statement …

Member Avatar for arkoenig
0
75
Member Avatar for plang007

setprecision affects the output stream, not the variable, therefore, it will continue to display the precision until you change it. Example: [code] #include <iostream> #include <iomanip> using std::cout; using std::setprecision; int main() { float x = 5.12384; cout << "Variable = " << x << "\n"; cout << "Precision 2 …

Member Avatar for Sky Diploma
0
332
Member Avatar for lochnessmonster

Short answer is no. Your example for "4" could be achieved with a simple if statement. I can't think of a single situation where this couldn't be replaced with something else. If your planning on using 1 in a lot of formulas but may need/want to change them all later …

Member Avatar for Red Goose
0
110
Member Avatar for TheLittleEngine

[QUOTE=TheLittleEngine;1473494] so far all I've understood is passing by reference creates a copy of the item[/QUOTE] Passing by reference does NOT create a copy of the item, that's the whole point of using it. It manipulates the original(by passing the memory address) so when your function ends any change you …

Member Avatar for TheLittleEngine
0
190
Member Avatar for geekme

Ubuntu should come prepacked with g++. If not: [code=bash] sudo apt-get install build-essential[/code] For dependencies, then... [code=bash] sudo apt-get install g++ [/code] It's a command-line compiler, meaning you'll have to operate it from the command prompt. If you don't like that idea, you could get code::blocks, and IDE, from the …

Member Avatar for ravenous
0
172
Member Avatar for ManCard67

How about you start by telling us what exactly you're having a problem with? Do you need help figuring out the logic?

Member Avatar for Sky Diploma
0
336
Member Avatar for rbduck09

I doubt you can even get it to compile, since you haven't included the proper headers for "cout" and "cin" Also, xact_type will always be equal to itself, your if statement is not doing anything. You had the right idea the first time, just the wrong syntax. You need to …

Member Avatar for rbduck09
0
144
Member Avatar for zhinokin

You need to put a length to compare. The compiler tells you the exact problem, not enough arguments, you need a size_t (or, rather, in the case of strings, string.size, usually) as a third parameter.

Member Avatar for zhinokin
0
603
Member Avatar for blee93

One thing sticks out, it's not a huge deal, but what if your user enters a word that starts with "q"? Since ch is equal to the first letter in the string it would quit on them even if they didn't actually want to. Also, you're only checking for lower …

Member Avatar for Red Goose
0
226
Member Avatar for strungoutfan78

You shouldn't need to dereference when passing by reference, only when it's a pointer. It seems peculiar but it could be a quirk of VC, especially if it compiles fine under other compilers. Does it run fine after you compile it in g++?

Member Avatar for strungoutfan78
0
399
Member Avatar for Lord_Migit

When you copy the vectors of pointers you copy the [b]locations[/b] they hold, meaning, you copy the address of the vector you're copying. The pointers then no longer have access to their previous values and if you initialized those values with the pointers they are now lost and cannot be …

Member Avatar for Lord_Migit
0
143
Member Avatar for alex55

[QUOTE=alex55;1469981]can i output to the same file twice without having it overwrite using my outFile stream?[/QUOTE] Yes. It depends on how you open the output file. You need to append it instead of truncate it. [icode] ofstream output(filename,[b]ios::app[/b]); //The bolded sets to append instead of truncate. [/icode]

Member Avatar for alex55
0
225

The End.