2,045 Posted Topics

Member Avatar for mingarrolo

[B]You should create a second [I]class [/I]called finalLab.[/B] You have made finalLab a method of the demoClass. [B]finalLab will have one method, one constructor and one property. The property will be a string called message.[/B] This will involve having a {get; set} after the property is defined [B]Your main method …

Member Avatar for Geekitygeek
0
121
Member Avatar for stevechow

WaltP was just pointing out that you need to take into account that row 0, row 19, column 0 and column 19 don't have neighbors to their up, down, left, and right respectively. Also, your for loops take into account 1-19, but your array actually starts at zero, so you …

Member Avatar for jonsca
0
139
Member Avatar for wittykitty
Member Avatar for jonsca
0
221
Member Avatar for blerina12

It's interpreting args[1] literally in the string, there's no translation that will take place. Make a C++ string out of "fc "+(string)args[1]+" ..\\o.txt" then pass that in as mystring.c_str() to system().

Member Avatar for blerina12
0
153
Member Avatar for JeyC

Once you have a breakpoint set, you can step through a few lines as needed and then hit F5 (or Continue in the debug menu or the green "play" button on the toolbar) and it will cycle through until it hits the breakpoint again.

Member Avatar for jonsca
0
102
Member Avatar for newcpp

You have the word comment in your code outside of any of the comments /* printf("%s\n",buf);*/ comment

Member Avatar for newcpp
0
78
Member Avatar for amishraa

use [icode] fin >> [/icode] and since you know the order of the line (1 string, 6 numbers, 1 string, 6 numbers, etc.) make a nested for loop (rows and then columns) to put them in their proper variables. P.S. It doesn't matter too much, but if you are going …

Member Avatar for amishraa
0
155
Member Avatar for PDB1982

That's also not the correct formula for the median I don't believe. AFAIK, if you have a set of numbers like 1 3 5 9 12, then 5 would be the median as it's the central value by count, 3rd from the beginning and 3rd from the last. When you …

Member Avatar for DavidRead
0
119
Member Avatar for nerdthon123
Re: Help

Welcome to the site. There are a number of inconsistencies that your compiler is trying to tell you about, this does not mean that your compiler is bad or faulty. [code] #include <iostream> //iostream.h is an outdated header from //prestandard days -- if your learning material //uses it it's probably …

Member Avatar for jonsca
0
127
Member Avatar for trzypak

Next time please use code tags. I don't think you have to worry about the minutes at all when you are doing your conversion. Since you know you are entering in military time, you can make your if statement if `(pHour >=0 && pHour<12)` for the AM/PM portion (I see …

Member Avatar for jonsca
0
117
Member Avatar for charlie221133

It's the one that comes up first (probably by careful design) when you search "C++ [anything]" on Google but I like [url]http://www.cplusplus.com/reference/[/url] It has the functions/methods from the major libraries (C and C++) and little code samples for most of them.

Member Avatar for mrnutty
0
72
Member Avatar for laelzio.mosca

I think the problem is you need to convert your checkWinner function to return a bool (true if there's a win or a tie and false if not). As I was attempting to do that I was thinking that you really should try to pare down player1() and player2() into …

Member Avatar for jonsca
0
63
Member Avatar for Iam3R

* (unary, dereferencing) has higher precedence than addition or subtraction, so it's like (*a)+1-(*a)+3.

Member Avatar for ssharish2005
2
203
Member Avatar for HunterFish

He said he [I]has[/I] examples for Windows but what he wants is examples that work under Linux

Member Avatar for Stefano Mtangoo
0
287
Member Avatar for bubonic88

Line 12: Char should be char Line 38: ) in the wrong place Line 40: ) in the wrong place Line 41: Extra ) Line 47: Extra ) Line 58: ) in the wrong place There may be others. When you compile please try to look over the lines which …

Member Avatar for xavier666
0
102
Member Avatar for laelzio.mosca

You need to put the strings in " ", so "BLANK","BLANK", etc. EDIT: It was in your prior posts, I overlooked it, sorry!

Member Avatar for Murtan
0
181
Member Avatar for jonsca

Is that "this thread is over three months old" warning new(it's possible I totally missed it before)? Either way I like it!!

Member Avatar for Narue
1
134
Member Avatar for otan

Welcome to the site. For us to best help you with your assignment, please post all relevant code and any specific questions that you have.

Member Avatar for jonsca
0
1K
Member Avatar for Gem74

Is there more to main? Sounds like you want to put a while loop so you can cycle through it again once you are done with the transaction. Also, in your last post you asked about the boolean for active/inactive. I was saying you should put a member in your …

Member Avatar for Murtan
0
277
Member Avatar for William Byrd II

Can you call [icode] Person::operator==(s) [/icode] in the derived class and AND the results with your derived class comparison? so like: [code] bool operator==(const Student& s) const { return (myStudentId == s.myStudentId && Person::operator==(s)); } [/code] EDIT: I did test it out and it seems to work.

Member Avatar for jonsca
0
107
Member Avatar for IcetalkeR

I ran across this (pursuing it out of curiosity) [url]http://services.aonaware.com/DictService/[/url] I have never used it and I'm not sure what the licensing terms are.

Member Avatar for jonsca
0
370
Member Avatar for ayan2587

I think the pointer is not initialized so when you try to dereference it the first time *s = a; it crashes. Setting s = &a; in conjunction with s = &b; after incrementing the pointer also works. Your cout should be dereferenced to view the char.

Member Avatar for jonsca
0
98
Member Avatar for squigworm

If you are calling your function with a specific element of each of those arrays, you are no longer passing an `int a[]` you are passing in a plain int. Your definition is treating it like you are sending in the whole array of size 20. If you are letting …

Member Avatar for lotrsimp12345
0
156
Member Avatar for merse

Shouldn't OP's overloaded operators for + only take one parameter (and return real &)? (or am I missing something)

Member Avatar for jonsca
0
117
Member Avatar for tak9

Unless you specifically send a linebreak to cout, it will keep printing on the same line, so basically you need: [code] cout <<" 1-10"; for loop(over the number of stars for that range) cout <<"*"; cout <<endl; //go to the next line [/code]

Member Avatar for Nick Evan
0
161
Member Avatar for PDB1982

pop in a variable to get that value for use in the subsequent function call [code] double avgstore; ..... Q6[i] << setw(8) << Final[i] << (avgstore = CalculateAvg (students, id, fname, lname, Q1, Q2, Q3, MidTerm, Q4, Q5, Q6, Final, i)); cout <<calcGrade(avgstore); (try it tacked onto the end of …

Member Avatar for jonsca
0
122
Member Avatar for merse

[QUOTE=merse;1066991]Sorry about that, but it was just a missprint, the problem is the same with this [CODE]struct mystruct { double x; mystruct(double x1) : x(x1) {}; }; T x; [b] Here you are trying to use a default constructor for your struct and there isn't one [/b] [/CODE][/QUOTE] I couldn't …

Member Avatar for jonsca
0
104
Member Avatar for Gem74

Can you add a private bool member to your savings class and simply use your status method to set it or unset it? You could have a "getter" to check it when the need arose. So in your withdrawal case, it would be savings.status(false); Also, put code tags around everything …

Member Avatar for Gem74
0
83
Member Avatar for ntouros
Member Avatar for ntouros
0
221
Member Avatar for PDB1982

Before anything else: I told you this was wrong... [icode] if (Q1[i] <= Q2[i] && Q3[i] && Q4[i] && Q5[i] && Q6[i]) [/icode] should be Q1[i] <=Q2[i] && Q1[i]<=Q3 && Q1[i] <=Q4[i] && Q1[i] <=Q5[i] && Q1[i]<=Q6[i] I know what you have compiles but that doesn't mean it works the …

Member Avatar for PDB1982
0
135
Member Avatar for arsenal23114

I think a circle is tough (I'm not totally familiar with the graphics lib you are using) but probably doable with putting one (dot, star etc) on the top line, on the next putting two spaced 1 away from the center dot on either side and one down,then putting 2 …

Member Avatar for mrnutty
1
92
Member Avatar for godsgift2dagame

string getName(); in the declaration should be void getName(string []); (you're going to pass it in by pointer so you won't have to return anything) in main() declare a string mystr[5]; (or however big you want it) and call a.getName(mystr); Then you can access mystr directly in once you're back …

Member Avatar for jonsca
0
165
Member Avatar for Jaydenn

Try [icode] yourtextbox.Text +="Your new line of text here \r\n"; [/icode] That gives you a carriage return and newline, and do this for every line that you add.

Member Avatar for Jaydenn
0
151
Member Avatar for BobRoss
Re: File

The code from post #4 ran on my machine and produced an output file.

Member Avatar for jonsca
0
111
Member Avatar for asweetroxxi

From line 33: outFile<<command<<" : is inserted"<< list.InsertItem(item)<<endl; is the first example the compiler picks up (and then gives a billion errors from the streams) but any time you have a method directed into an output stream int must have a return value and your InsertItem is void. I think …

Member Avatar for jonsca
0
210
Member Avatar for PDB1982

Within your block [code] for (i = 0; i < 6; ++i ) { if ( students >> studentid[i] >> fname[i] >> lname[i] >> Q1[i] >> Q2[i] >> Q3[i] >> MidTerm[i] >> Q4[i] >> Q5[i] >> Q6[i] >> Final[i]) [/code] you have cout << all your stuff CalculateAverage() //prints out …

Member Avatar for jonsca
0
118
Member Avatar for xcorpionxting

Since your classes are really pointers you need the -> operator to dereference and dot them (*A.member() is the same as A->member() ) (also, instead of iostream.h #include<iostream> and instead of stdlib.h #include<cstdlib> and <ctime> in place of time.h -- these are the standard headers you should be using -- …

Member Avatar for xcorpionxting
0
177
Member Avatar for NinjaLink

Maybe I'm missing something but hashArray has nothing in it. I'm not sure why you are treating your numbers as chars?

Member Avatar for jonsca
0
135
Member Avatar for tasky23

[QUOTE=GrubSchumi;1064300]Hi tasky23, You need a bit more to open the file. Declaring an instance of ifstream is the correct start but it should read: [CODE] ifstream infile2; //then to open the file. infile2.open("file.txt",ios::in); [/CODE] [/QUOTE] See: [url]http://www.cplusplus.com/reference/iostream/ifstream/ifstream/[/url] his notation is a shortcut. @OP: I think the brevity of your post …

Member Avatar for jonsca
1
133
Member Avatar for soapyillusion

Please use code-tags the next time... double rad; double circum; double ar; double radius1; double circumfrence1; const double pi=3.141616; cout << "This Program Finds The Area, Radius and Circumfrence of a circle!" << endl; cout << "Please where the center of the circle is, please enter two numbers " << …

Member Avatar for soapyillusion
0
144
Member Avatar for mitchstokes225

Just take away the <=10 and substitute in <10, going less than or equal to will overstep your array. Also, you can accomplish the first part with just the loop variables (no need for n) ;)

Member Avatar for mitchstokes225
0
1K
Member Avatar for rzhaley

Shouldn't line 32 just be [icode] p = i+p;[/icode] (or p+=i; )? That way you put your interest into principal and iterate again.

Member Avatar for jonsca
0
123
Member Avatar for kavourdoukos

You have to [icode] #include <algorithm> [/icode] and call: [icode]sort (myvector.begin(), myvector.end());[/icode] (see [url]http://www.cplusplus.com/reference/algorithm/sort/[/url] for a reference)

Member Avatar for jonsca
0
65
Member Avatar for kelton52

.NET has this [url]http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx[/url] but I don't know if you wanted win32/unmanaged (you'd need the HighResolution on -- I'm trying to find the order or magnitude of the smallest timestep -- looks like it's 100 nano) [code] Elapsed = 00:00:00.0052618 [/code] Though I'm sure the figure it gives comes with …

Member Avatar for jonsca
0
124
Member Avatar for rzhaley

The {0,20} is a placeholder and format specifier for a variable that was in the other example you had. For example: [code] int i = 1; char a = 'a'; double pi = 3.14159; Console.WriteLine("{0} {1} {2}",i,a,pi); [/code] prints out: 1 a 3.14145 (each placeholder is replaced by the value) …

Member Avatar for jonsca
0
99
Member Avatar for NitaB

Me again... :) ROW is not in scope in your function (I checked your other post). You'll want to either put it through a debugger (or put in a temporary int variable to count your loops or print out something etc) to make sure it goes through enough loops. It …

Member Avatar for NitaB
0
588
Member Avatar for Viralguardian

Your counter values do not exist outside of the loop scope e.g. [code] void getData( int compMenuList[], int counter1) { counter1 = 0; cout << "Enter the menu choice(s): "; for(counter1 = 0; counter1 < 7; counter1++) { cin >> compMenuList[counter1]; if(compMenuList[counter1] = -999) break; } } [/code] Firstly, counter1 …

Member Avatar for Viralguardian
0
206
Member Avatar for saharh89

Parent class functions that need to be different than their parent class counterparts must be labeled virtual. This lets the compiler know that the method will be attached dynamically (i.e., depending on the type of the object at runtime). If I have a class called hasmotoroutside I can derive and …

Member Avatar for Narue
0
166
Member Avatar for Kennych

I'm sure there are more elegant solutions to this problem, but here's an example I thought of [code] bool exitloop = false; switch(ch1) { case 1 :{ while(1) { cout<<" Directory Selection"<<endl; cout<<" 1. Computing Science "<<endl; cout<<" Enter your choice : "; cin>>ch2; switch(ch2){ case 1 : break; //out …

Member Avatar for jonsca
0
856
Member Avatar for kawal.singh

Ancient Dragon gave you some links to freely available libraries in your other post. If you're up for some theory check out [url]http://en.wikipedia.org/wiki/Lempel-Ziv[/url] but it's definitely preferable to use a library rather than re-implementing from scratch. Please elaborate on what help you need with the compression if this is not …

Member Avatar for kawal.singh
0
204

The End.