2,045 Posted Topics

Member Avatar for programer25

Welcome. [URL="http://www.daniweb.com/forums/announcement8-2.html"]What have you tried so far?[/URL]

Member Avatar for mrnutty
0
91
Member Avatar for bsbomb21

It's a "hard space" that you probably copied in from a web page by mistake. Either find the line that it is on and put the cursor on the beginning of each space, hit delete to clear it then hit spacebar (do that for each one) -or- copy the program …

Member Avatar for jonsca
0
535
Member Avatar for greatunknown
Member Avatar for greatunknown
0
111
Member Avatar for steviebax

Use a combination of [URL="http://www.cplusplus.com/reference/string/string/find_last_of/"]find_last_of[/URL](to get the last period) and [URL="http://www.cplusplus.com/reference/string/string/substr/"]substr[/URL](to grab everything up until that point) and then append the .png to the substring. Or if you know your filenames are always going to be a fixed length, just overwrite the last 3 letters with "png" (op[15] = 'p' …

Member Avatar for steviebax
0
101
Member Avatar for lethal.b

The OP wants to print the letters not used in the original "key" after they have output said key (I think the OP left an h in the extra letters of the example which was confusing). I would use a string like lotrsimp said, but in your alpha collection write …

Member Avatar for jonsca
0
112
Member Avatar for jose385

Hint, how many stars are in each row. Row 1 ___ Row 2 ___ See any pattern you can use?

Member Avatar for jephthah
0
302
Member Avatar for dillinger88

Are you trying to compile it as a CLR application? (I noticed you added in the ref class keyword). If not, change your project type to Win32 console app, that will get you the standard C++ flavor.

Member Avatar for dillinger88
0
205
Member Avatar for ttunstall07

Where do the hours data for the first person go once you read in those of the second person? I would make that a 2D array also. If you're going to read in a name with a space in it you won't be able to use cin. Use cin.getline() instead. …

Member Avatar for jonsca
0
79
Member Avatar for drewangel

Since none of the equations depend on each other at all you can solve it as 3 separate quadratic equations so either with a root finder or the brute force (-b+- sqrt(b^2 - 4ac)) /2a business.

Member Avatar for ninjasmith
0
3K
Member Avatar for Geekitygeek

Being from the same "generation" of members I've noticed this too. There are others in the same boat. Give this a read: [url]http://www.daniweb.com/forums/thread229580.html[/url] Since this has been an issue of great debate I'm persuaded to think that it makes sense this way over the long haul.

Member Avatar for Geekitygeek
0
185
Member Avatar for loststudent88

What have you tried so far? It's a matter of parsing the hex digits 2 at a time and converting them to decimal (for digits, convert to an int by subtracting '0' and by using a switch statement to convert a or A to 10, etc.).

Member Avatar for mrnutty
0
322
Member Avatar for lee.j.baxter

Your work sounds really interesting. Unfortunately, I don't have any concrete input for you. I'm familiar with some time-frequency stuff but applying that would be a guess on my part. However a good place to direct your search(in addition to posting here of course) would be in IEEE Xplore database …

Member Avatar for kvprajapati
0
207
Member Avatar for jjmy95
Member Avatar for sssouljah

Give this a read about the [URL="http://www.learncpp.com/cpp-tutorial/99-overloading-the-parenthesis-operator/"]parentheses operator[/URL]. It's partly relevant to your problem. When you are thinking about how to divide the numbers up, if row and column are the position of any one element, what is the relationship between row and column in any of the 3 matrices? …

Member Avatar for jonsca
0
205
Member Avatar for Deey

Once you've got the control on the form in your code add an event handler to it programatically. For example: [icode]this.panel1.Click += new System.EventHandler(this.panel1_Click);[/icode] (and of course you need to code the panel1_Click method just like you would have done by clicking on the properties window). Then just use the …

Member Avatar for Geekitygeek
0
102
Member Avatar for aruprongs

Please use code tags in your next post. They are easy to use and help everyone read your code (and therefore help you) more effectively Simple as: [noparse] [code] //code goes here //more code [/code] [/noparse] main() returns an int (always). Don't use .eof when reading in files(see [URL="http://www.daniweb.com/forums/post155265-18.html"]this[/URL]). So …

Member Avatar for lotrsimp12345
0
75
Member Avatar for libby71

A departure from the topic a bit, and [URL="http://windowsdevcenter.com/pub/a/windows/2005/04/12/automate_xp.html"]this article[/URL] I found is getting to be a bit dated, but have you considered some kind of "macro recorder"? [quote]Yes it can. [/quote] WaltP in 2012?

Member Avatar for jonsca
0
94
Member Avatar for nerdy900

[code] declares an array of strings string item_name[number_of_items]; cout << "How many items does the customer have? \n"; cin >> number_of_items; [/code] When specifying the size of an array in the declaration like that on line 22, the value of number_of_items must be known at compile time (unless you have …

Member Avatar for nerdy900
0
114
Member Avatar for jeevsmyd

Put in a [iCODE]cin.get();[/iCODE] in between lines 9 and 10. It's along the same lines but it's also nice and standard.

Member Avatar for WaltP
0
89
Member Avatar for eddan

Lines 22 and 23 are prototypes which should in 99.9% of cases be placed outside of main replacing lines 11 and 12. GetNumber1() and GetNumber2() functions are returning values and you're not "catching" them with anything like a variable local to main().I understand what you were assuming but the x …

Member Avatar for mitrmkar
0
148
Member Avatar for Violet_82

[QUOTE=tkud;1151332]I do not understand your code... First you should have just used[CODE]using namespace std;[/CODE] instead of waht you did, you also did not initialize your variables,and then you kept repeating the same conditions: [/quote] [code] using std::cout; using std::cin; using std::endl; [/code] is actually perfectly acceptable and in many situations …

Member Avatar for jonsca
0
157
Member Avatar for bhp2005

Think of P0 as a point on your shoulder, L0 to be the length of your upper arm, and L1 to be the length of your forearm. Now, put your finger at an imaginary point in space (don't allow your wrist to rotate). That's P1. Now if you have P1 …

Member Avatar for jonsca
0
162
Member Avatar for wolfkrug

So print out avgRain[x] between lines 21 and 22 (as WaltP was suggesting) check to make sure you're getting something there. You also don't check the status of the file with the is_open() method. It may be that you're trying to open something in a directory outside of the one …

Member Avatar for WaltP
0
182
Member Avatar for csfriends

You missed the obvious option, jwenting. Open the skull, put black ink over the cortex, stamp it on a sheet of paper. Voila, brain fingerprinting.

Member Avatar for peter_budo
-1
179
Member Avatar for nats01282

Are you using Windows or *nix? windows.h has a sleep() function. See this thread about ways to do it with the ctime header:[url]http://www.daniweb.com/forums/thread233015.html[/url] I know you're not asking for help on this part, but you should reform your goto into a do/while loop. It's a lot easier to follow that …

Member Avatar for Stefano Mtangoo
0
168
Member Avatar for wolfkrug

There are potentially a few issues here. If the document is up and running in word it may be locked as far as the file system is concerned (I have not tested this). If you are trying to read from a Word document in text mode (as in from a …

Member Avatar for jonsca
0
149
Member Avatar for nickewus24

Say that your first else if has an if statement within it and then that if statement has yet another. This is nesting. (not sure what language you're using so I'll keep it generic) [code] if () else if() if() if() else else if() etc. [/code] You should be able …

Member Avatar for nickewus24
0
102
Member Avatar for PDB1982

As far as [icode]Rational( int = 0, int = 1 );[/icode], test that way of writing it to make sure it works. A more effective way to write it would be [icode] Rational(int num=0,int den=1):Numerator_(num),Denominator(den) {} [/icode]

Member Avatar for tetron
0
2K
Member Avatar for ELBUF

You should declare count (and initialize it!) before the while loop then increment it within. What you are doing there doesn't make any sense syntactically. I also question doing this much processing in the overloaded << method. Normally the second parameter is of const Bignumber & type, so perhaps delegate …

Member Avatar for ELBUF
0
126
Member Avatar for jimJohnson

[icode] inFile.open(filename.[COLOR="Green"]c_str()[/COLOR]); [/icode] will open up the file using the filename (that c_str() method provides the C string representation)

Member Avatar for jonsca
0
248
Member Avatar for Don_k

Take a quick look at an ASCII table ([url]http://web.cs.mun.ca/~michael/c/ascii-table.html[/url] for example) as to how 'a' relates to 'A'

Member Avatar for Dave Sinkula
0
122
Member Avatar for BeyondTheEye

I wish I had a direct answer for you but some poking around yielded [URL="http://stackoverflow.com/questions/820817/low-level-control-of-rs232-com-port-rts-cts-dtr-dsr-possible"]this thread[/URL] which had a couple of good links. I don't know if it's what you're looking for or if you already ran across it.

Member Avatar for BeyondTheEye
0
264
Member Avatar for react05

[icode]value1 = stk.pop( );[/icode] doesn't work because pop is void. Use your top method[/URL] to access the value of the next item on the stack and then pop it off after that with the pop() method.

Member Avatar for react05
0
205
Member Avatar for qk00002

[QUOTE=qk00002;1147641]Hi, I am working on visual studio 2008 C++ and I have done the C++ general code, my question is can I convert my general code to be C++ CLR in visual studio 2008? This will make my work easier. [/quote] [URL="http://www.codeproject.com/KB/books/CppCliInActionCh1Ex1.aspx"]This[/URL] is an excerpt from a book by [URL="http://blog.voidnish.com/"]Nishant …

Member Avatar for jonsca
0
251
Member Avatar for Agello

Give[URL="http://www.gidnetwork.com/b-60.html"] this [/URL]a read. There can be problems with stray '\n' (newline) characters in the buffer. The code snippet there shows how to flush them out (and even offers the use of getchar as a more effective method in this case.

Member Avatar for Agello
0
262
Member Avatar for clutchkiller

You need to static_cast<int>(something) you can't just have it by itself. In reality you may not even need it at all, remember that chars are one-byte ints. If anything at all you'd almost need static_cast<char> for that quantity to put it back into buffer.

Member Avatar for jonsca
0
102
Member Avatar for asa88

The first problem is your indicies are off on [icode]sum+=val[x-i]*pow(2.0,i-1);[/icode] Write it out on paper, in an example with an 8 digit number, you want: val[0] times 2^7+ val[1]*2^6 etc which means you also need to change where the for loop begins. Put some couts in there to see how …

Member Avatar for thomas_naveen
0
115
Member Avatar for timbomo

There are no conditions on an else statement. You could have an else if with conditions but I don't think that's what you need here.

Member Avatar for Fbody
0
250
Member Avatar for Cristofor

Right after your [iCODE]cin >> n[/iCODE] line, put a [iCODE]cin.ignore()[/iCODE]. When you are entering the number there's the newline that came after it when you pressed enter. It gets stuck in the stream. The getline (the first time through the loop) is simply taking this '\n' in and thinking that …

Member Avatar for Cristofor
0
106
Member Avatar for daniwebrandom

Ala00003 the right idea. A dot product is really a projection of one vector on to another but can be thought of as a sort of correlation. Look into the other formula for the dot product (they are in fact equivalent but with n years of brain rust I can't …

Member Avatar for jonsca
0
191
Member Avatar for tquiva

If a number that you pick up is higher than all the other numbers, does it matter what the other numbers are? If a number that you pick up is smaller than all the others that you have does it matter what the higher numbers are (with the exception of …

Member Avatar for tquiva
0
228
Member Avatar for timbomo

Aside from all the rest of the situation you've got semicolons after your for statements. The loops definitely won't run then. Just my $0.02, sit down away from the PC with your text and study the for loop because you're just going to frustrate yourself at this rate. I'm referring …

Member Avatar for timbomo
0
297
Member Avatar for sexyzebra19

Take a closer look at your index on your b.data_ vector on line 15. The pattern that you have is this: [code] i,j,index of A,index of B 0,1 0 0 0,2 2 1 1,1 1 0 1,2 3 1 2,1 0 1 2,2 2 2 3,1 1 1 3,2 3 …

Member Avatar for sexyzebra19
0
96
Member Avatar for tquiva

What is value equal to when you enter into your function? The answer is any random bytes that happened to fall into that region all interpreted as a float. I know you've seen this issue before in other threads.

Member Avatar for anup375
0
109
Member Avatar for Cardinals1980

Can you write a program that prints out every value from 1 to 20? What type of loop are you thinking of using? With those questions in mind, try something out first and post your code and we can help you with it. EDIT: Well apegram edged me out by …

Member Avatar for ddanbe
0
106
Member Avatar for maharjun

A few preliminaries: [icode] <iostream.h> [/icode]has long been standardized to [icode]<iostream>[/icode]. When using [iCODE]string.h[/iCODE] with C++ you should include it as [icode]<cstring>[/icode]. Also the conio routine is non-standard. Finally, main must return an int according to the standard. You need to change your = operator to look something like this: …

Member Avatar for mattjbond
0
181
Member Avatar for hwlibra083

Line 95: The arguments to this function are pointers use [icode]push(&rowElement, &colElement);[/icode] Line 161: Opposite problem, row and col are pointers (the ones passed into the function, so dereference the right hand side like [icode]newPtr->row = *row;[/icode] Line 199: same as 161. Line 184: same as line 95 (around 184 …

Member Avatar for jonsca
0
220
Member Avatar for gnarlyskim

You can use the degree of the polynomial to allocate an array of size degree+1 (to hold the constant) for each line. Your degree will let you read ahead to see how many times you should go through a loop collecting coefficients and then just grab the last 2 values. …

Member Avatar for gnarlyskim
1
184
Member Avatar for rockstar8577
Member Avatar for jonsca
0
84
Member Avatar for MWE_QUE

Can you give a sample input/output session (a limited one)? Also, your variable declarations should all be at the top of a block (e.g., at the top of main()) in order to be standard.

Member Avatar for MWE_QUE
0
129

The End.