78 Posted Topics

Member Avatar for bdkminang
Member Avatar for jonspeidel

[QUOTE=VernonDozier;1468991]To the OP... You might want to consider starting a new thread. This one's pretty long. No one like me who hasn't been following this is going to go back through all the old posts, so no one new is going to comment probably. As far as portability, obsolete headers, …

Member Avatar for 1ML
0
527
Member Avatar for Akill10

I don't understand this: [code] if (my_array != 0) [/code] What [b]exactly[/b] are you checking for, and for what purpose?

Member Avatar for Akill10
0
223
Member Avatar for jkoske

[QUOTE=firstPerson;1468926]from what I can see your code is prefect. Bugs free, fast, and takes no memory space.and its portable. Congrats.[/QUOTE] I get a syntax error.

Member Avatar for Red Goose
0
85
Member Avatar for airerdem

If you're saying that you want to exit the J loop at that point [b]and not enter it again[/b], you could always add a bool statement and check on it before each j loop execution.

Member Avatar for airerdem
0
108
Member Avatar for comSysStudent

You're correct, your array is going out of scope. You need to either pass your array by reference or by pointer. I suggest reference unless you explicitly need pointers. [code] void readArr(int rows, int cols, fArray& array) [/code] And that should do it. You need to add the reference to …

Member Avatar for comSysStudent
0
219
Member Avatar for skips

Just an FYI, to make your code cleaner, you don't need to check if your input number is larger than nine, since logically a digit cannot be higher than 9. You only need to make sure your division doesn't result in zero. Also, remember what your division and modulation is …

Member Avatar for Red Goose
0
131
Member Avatar for jhollie

What's your question? It looks like you just copy pasted a code. Also, use CODE tags

Member Avatar for chrjs
-1
143
Member Avatar for kamotekid08

I'm sure [url=http://www.sgi.com/tech/stl/Map.html] std map [/url] does all that for you. If you need duplicates, use [url=http://www.sgi.com/tech/stl/Multimap.html] std multi map[/url].

Member Avatar for jonsca
0
3K
Member Avatar for Lemonader

What exactly are you trying to test? If you expect a variable to be something but aren't sure if it will be that, you should use an ASSERT macro. [code] #define DEBUG // Get rid of this once you're done debugging. #ifndef DEBUG #define ASSERT(x) #else #define ASSERT(x) \ //single …

Member Avatar for Lemonader
0
158
Member Avatar for david09436

One thing I'd suggest, just from skimming the code, is to try to let your functions only deal with one student at a time unless you're comparing the two students. There's no need to plug 5 student objects into a function at once, and would look much cleaner and be …

Member Avatar for Red Goose
-3
151
Member Avatar for hq1

Your variables are most likely going out of range. There a few ways to correct this. One would be to have the functions return the values to plug in, such as: [code] //in main for (int i = 0; i != SIZE - 1; i++) A[i] = InputValue1(); //function int …

Member Avatar for danb737
0
1K
Member Avatar for livinFuture

Don't hit enter after each input. Enter literally tells the console to make a new line. A simple space will suffice to separate the variables.

Member Avatar for mrnutty
0
12K
Member Avatar for Foxfreezer

You're using the argc all wrong. The int main initialization as shown: [code] int main(int argc, char ** argv) [/code] Assigns the numbers of arguments in the console during the executing to argc and creates an array of arrays of characters (basically an array of strings) containing each argument, the …

Member Avatar for WaltP
0
193
Member Avatar for Games53
Re: Help

You may want to learn some about bitwise operators as well, bit reading makes converting from hex to decimal and back again easy as pie.

Member Avatar for Red Goose
0
89
Member Avatar for Firsum

[quote]4.) There's nothing wrong with your codes. What's wrong with "Go To"? What matters is the purpose and the content of your program. Think of the people who will use the program.[/quote] "Goto" and other sloppy design methods, while they may work, often lead to one when needing to fix …

Member Avatar for jember
0
370
Member Avatar for kikirkou

[QUOTE=kikirkou;1443670]Hi all A teacher of mine told me that when an object of a class is created then six things are created.He didn't told me which.I know the obvious 4 things 1)Copy constructor 2)Copy asignment 3)Constructor 4)Deconstructor I don't know anything else?Do you have ab\ny idea?I searched everywhere but i …

Member Avatar for Narue
0
126
Member Avatar for Wej00

The convention is pointers, or references. [code] //Passing a variable via a reference! #include <iostream> using namespace std; void swap(int & x, int & y); int main() { int x = 1; int y = 6; cout << "\nBefore Swap, in Main: " << x <<" "<< y << "\n"; …

Member Avatar for Banfa
0
1K
Member Avatar for imolorhe

Is there any particular reason you can't use a vector? Because it seems that iterators would do all that for you. Or a list, if your planning to constantly access different points. I'm sure someone could figure out a way to do it, but it would ultimately feel needless since …

Member Avatar for mrnutty
0
533
Member Avatar for simply_viks

I'd suggest learning how to use vectors, since after doing so you'd have a more powerful array that, once learned, is easier to use. With a vector, you could just write: [code] mArray.size(); [/code] And there ya go.

Member Avatar for hillstone_softw
0
190
Member Avatar for lulzy
Member Avatar for MasterGberry

[quote] [code] auto item = new AoE2Wide::Item{Pos, rf, "", ""};[/code] [/quote] Your declaration of "Item" is lower case here, though the class itself is uppercase. [code] auto Item * AoE2Wide= new Item(Pos, rf, "", "");[/code] Does this work? Or am I misunderstanding your intention? I'm pretty sure you can't use …

Member Avatar for MasterGberry
0
573
Member Avatar for MasterGberry

[QUOTE=MasterGberry;1439421]When I did the & it wouldn't work. The problem is I am using a private ref class, not a standard class, which I read is different...[/QUOTE] Could you post the class declaration? I think the biggest issue you're having is your constructor doesn't match the declaration, though I really …

Member Avatar for MasterGberry
0
1K
Member Avatar for alonewolf23

I think the problem is that you're checking if the numbers are even [b]every time[/b] even though this is in no way necessary. If your first number is even, you can't subtract 2 to get an odd number. See here: [code] #include <iostream> using namespace std; int main() { int …

Member Avatar for Red Goose
0
139
Member Avatar for alonewolf23

Did your books teach you how to declare functions? Look for something on "Prototypes". It SHOULD be in the functions section. Is it necessary in this particular case? No. But is it a good habit that you should become accustomed to? Absolutely.

Member Avatar for jonsca
0
841
Member Avatar for Alyboi

Remember whitespace. The ";" operator is what the compiler uses to identify a new line. When you write: [code]int grade1 = 0; 30; [/code] The compiler reads it as: [code] int grade1 = 0; //end of the variable!! 30; [/code] If you want to compare between to numbers (0 - …

Member Avatar for Red Goose
-1
125
Member Avatar for jitender939
Member Avatar for Red Goose
0
122
Member Avatar for cute cat

Here, I'll give you the logic, and I'll leave it to you to write the program: For each digit, you need to check if one is bigger than the other, if it is, set a variable to define that string as the bigger one. This variable should only be assessable …

Member Avatar for Red Goose
0
202

The End.