2,045 Posted Topics

Member Avatar for scarlettmoon

[icode]index <= 5[/icode] Your array is only 5 elements long, you should go up to [icode] <5 [/icode] only (0,1,2,3,4)

Member Avatar for scarlettmoon
0
134
Member Avatar for Tinee

[code] if (file == "Forces1" || "forces1") [/code] must be [code] if(file == "Forces1" || file == "forces1") [/code] otherwise, in the first instance it's evaluating "forces1" as true since it is not null, so your statement's always true. Same thing for the else if condition, too.

Member Avatar for Tinee
0
107
Member Avatar for Shruti4444

Duplicate words? Duplicate letters? Duplicity? What have you done on this so far? Are you allowed to use methods from the standard library (e.g., std::sort, and std::unique)?

Member Avatar for mike_2000_17
0
2K
Member Avatar for Lokril

[quote]Check my answer to question![/quote] That comes across as very rude. Use braces to tell you which ifs and elses match up (when the if statement only has one line of code following it, you technically don't need them, but it should help you see where your errors are) [code] …

Member Avatar for Lokril
0
116
Member Avatar for magravis

[quote]i have the "HEY" stored as an "string command" and the number stored under as a op1[i] array [/quote] I'm really not sure what you're trying to say there, but it only makes sense in the context of your program. Please post your code.

Member Avatar for magravis
0
110
Member Avatar for taumang
Member Avatar for madifemo
-1
235
Member Avatar for Dani
Member Avatar for Kadence

I'm not sure if this will work, but try referring to the global one as [icode] ::thread [/icode] and the Boost one as [icode]Boost::thread [/icode]. Edit: no, the more I think of it, the even less I think that will do it because the global one is a define, you're …

Member Avatar for Kadence
0
287
Member Avatar for computerdude87

[quote]Hope its not a homework>>>[/quote] Homework questions are fine as long as the poster has shown effort.

Member Avatar for jonsca
0
109
Member Avatar for triumphost

Depending on what you are actually going to do with the .NET code, you can relax the compilation from /CLR:pure setting to just /CLR (within the project propeties) and see if the two will play along. The unmanaged code is not called CLR, by the way. The CLR is the …

Member Avatar for triumphost
0
328
Member Avatar for HitnBooks

What does it mean that they don't look quite right? Are you calling SetPrice and SetTitle one after the other and it's skipping over your SetTitle input?

Member Avatar for venomxxl
0
145
Member Avatar for veda&&
Member Avatar for fadi_1234

Preincrement and postincrement: [url]http://www.codeguru.com/forum/showthread.php?t=231052[/url] Type casting: (static is about 3/4 down the page) [url]http://www.cplusplus.com/doc/tutorial/typecasting/[/url] setiosflags [url]http://www.cplusplus.com/reference/iostream/manipulators/setiosflags/[/url]

Member Avatar for fadi_1234
0
88
Member Avatar for cornedor
Member Avatar for jonsca
0
122
Member Avatar for SWEngineer

Please don't post your questions on multiple sites at the same time. You'll end up wasting the time of people on one or the other.

Member Avatar for jonsca
0
133
Member Avatar for Christoph928

I would use 1 while loop (just like your second one) and put an if/else in there to distinguish between matched words and regular words and then up the count on each when appropriate.

Member Avatar for bharathmakawana
0
175
Member Avatar for amna masood

You're on to the right idea. You can use the if statements that you already have (with some modifications) or you can use the functions found in <cctype> (isalpha(), etc.) Looking at your second to last blue code block, you can see that you can't compare a character to a …

Member Avatar for redmaiev04
0
176
Member Avatar for Danny1994

That's a linker error, actually. Have you pointed VC++ to the right library directory and listed out the .lib files you want it to link to? (all this under Project/Properties/CC++/Linker (inputs and general)

Member Avatar for Danny1994
0
2K
Member Avatar for shuzay8

What does your question have to do with the subject of the thread? Have you tried searching on Google? There are at least a few pages particular to C++ flowcharts, but as far as I can remember, the process is pretty much language agnostic.

Member Avatar for jonsca
0
97
Member Avatar for Gobbler

[code] if (yn == "yes" || "y" || "yeah" || "yep") [/code] doesn't work, it must be [code] if(yn=="yes" ||yn=="y"||yn=="yeah"||yn=="yep") [/code] On line 32, you're not using the return value of quant anyway, but to return more than one thing from a function, use references: [code] //sending in 2 references …

Member Avatar for jonsca
0
112
Member Avatar for dumb.king12

Can you read in a text file? Can you count the number of words in a string? Start by gathering some of the pieces that you can do together, and try to integrate them into one whole program. [quote]coz im only 1st yr college student[/quote] All the more reason for …

Member Avatar for Stefano Mtangoo
-2
114
Member Avatar for Khoanyneosr

I get quite a few compilation errors with your code about your use of the methods in algorithm. As an aside, check out [url]http://www.daniweb.com/software-development/cpp/threads/262894[/url] for Narue's solution to the problem with using toupper in this context. Edit: you didn't include <limits> for the cin.ignore call [code] vector<string> words; const string …

Member Avatar for jonsca
0
166
Member Avatar for c++prog

Okay, I'm all done with it. What now? What have you tried at this point? Please post your efforts.

Member Avatar for zaneulhaq
0
72
Member Avatar for pmark019

One way would be to go through the string and replace the ':' with a ' ' (either in a for loop, or through something like the .replace() method of the string. Edit: Vijayan has a good way ^^^^^^^^^ (I was thinking along those lines but was trying other rhings, …

Member Avatar for pmark019
0
1K
Member Avatar for JJmaster08

If you indented and spaced your code properly like [code] if(etc) { //code indented here } else if (etc) { //code indented here if(etc) { //code indented here } } else { } [/code] you'd probably notice it right away. Try that and see if you can find it and …

Member Avatar for jonsca
0
128
Member Avatar for frogboy77

I would say no, at least not evaluating them over the long term. Sometimes it takes longer for something to click with someone, but once they understand it, they're off. If people ask what might seem like stupid questions, they may be chipping away at it, but then suddenly understand …

Member Avatar for jonsca
0
123
Member Avatar for triumphost

See [URL="http://stackoverflow.com/q/1862590/646382"]this[/URL] thread on Stack. It's using C#, but you should be able to translate the syntax readily. Like I had said in the other thread, it takes a little wizardry to update the GUI from another thread (which is basically what the backgroundworker is). I have never actually implemented …

Member Avatar for jonsca
0
235
Member Avatar for mas51

Why are you inheriting from string on line 5? There's no need to do that. You should have a private member variable that's of type std::string to receive your aString variable on line 12. I don't believe what you are trying to do will work. [quote]c++,html,javascript,PHP,SQL,and c#[/quote] Get a copy …

Member Avatar for jonsca
0
228
Member Avatar for GhostMonkey

[quote]its at the bottom of the page instead of where the array is[/quote] I'm not exactly sure what you mean by that, can you show a sample output?

Member Avatar for GhostMonkey
0
77
Member Avatar for mincuu

[quote]except that the calculation part gives me different figures [/quote] Please try to narrow the error down to a section of code. I can't compile the whole thing because it's been Borlandated.

Member Avatar for jonsca
0
300
Member Avatar for triumphost

The [icode] StringF[/icode] in [icode]Form1_Load()[/icode] is a local variable, which masks the "global" (really it's a member of the Form1 class) variable. Remove the [icode]System::String ^ [/icode] portion off of the one in Form1_Load and it should be all set.

Member Avatar for jonsca
0
121
Member Avatar for hawita

You've got some sense of the problem, but your code is incorrect. You declare y as a string on line 7, but treat it like an array of strings on line 12. In addition, your index of that array is a char, which could be technically correct, but, for example, …

Member Avatar for abhimanipal
0
201
Member Avatar for bigwhiteegg

To do that with C++, you need something like libcurl ([url]http://curl.haxx.se/libcurl/[/url]).

Member Avatar for Stefano Mtangoo
0
152
Member Avatar for debasisdas

No, I think you were well within your rights to say that. He didn't offer you any constructive criticism/justification with the downrep, so I wouldn't take it to heart. You contribute a lot to the site, so just let the good reps counterbalance this one. P.S. The real crime here …

Member Avatar for VernonDozier
0
203
Member Avatar for Ancient Dragon

The line for rep count on the profile gets connected to zero if you haven't gained any rep yet that week, it doesn't mean there's been anything negative(if it had been negative, I think the entire graph shifts up so it's noticiable). In any case, I only saw an upvote …

Member Avatar for Dani
0
196
Member Avatar for El3et

[icode] itsRadius [/icode] is a pointer, you need to dereference it before incrementing it.

Member Avatar for El3et
0
134
Member Avatar for Wheaties

Is there going to be one number per line? There many different ways to do it. I'll list two that come to mind. One way is to read the data in just to count how many elements there are and then allocate an array that is that size. Then you …

Member Avatar for jonsca
0
173
Member Avatar for Bedo

Rather than initially trying to shuffle your code all around, make a new file with a new main. Write the functions in that new file and test them with simple cases using the new main. Then once you've got them tested, copy them back into the old main and prototype …

Member Avatar for jonsca
0
114
Member Avatar for ztdep

Please show the code where you are resetting it to "". Edit: Try his ^^^^^^ suggestion first.

Member Avatar for jonsca
0
114
Member Avatar for frogboy77

What is the desired behavior on #3? If you type the link in plain text, it will be parsed into the abbreviated form like that automatically.

Member Avatar for sania85
0
845
Member Avatar for pseudorandom21

Did you run into this one [url]http://www.scribd.com/doc/43968817/Write-a-Program-for-Imlementing-Perceptron-Learning-Algorithm[/url] ? Which part of the cprog part is giving you trouble? The Perceptron is a pretty bare bones architecture, and there are lots of situations where it just plain doesn't converge. What type of project are you adopting it into? (if it's not …

Member Avatar for jonsca
0
82
Member Avatar for exo47r28
Member Avatar for exo47r28
0
136
Member Avatar for happygeek

[quote]Why, at this rate there are like only a hundred or less members a day[/quote] Wait until it becomes exam time at the universities. I couldn't quantify the surge, but there definitely is one.

Member Avatar for TrustyTony
0
477
Member Avatar for Taibah

Check out [url]http://www.winprog.org/tutorial/[/url] for information on the Win32 API. If you want a strictly C++ approach, look into MFC, but you need the full version of Visual Studio to use it. There's also Winforms via .NET, but they use C++/CLI, which is a dialect of C++ and not the standard …

Member Avatar for mytich
0
182
Member Avatar for SWEngineer

Make sure that Qt is on your path, or start up the "Qt 4.x.x Command Prompt" from the start menu. Switch to your code directory and type: [code] qmake -project (which sets up the project folders) qmake hello.pro (or whatever you want to name the makefile, but I think it …

Member Avatar for jonsca
0
279
Member Avatar for CrazyProgrammer

C++/CLI is the dialect of C++ which you use under the CLR. Languages that use the CLI have their code converted to MSIL (which is like assembly language, but not quite the same). The MSIL code gets run on a virtual machine, and a just in time (JIT) compiler turns …

Member Avatar for CrazyProgrammer
0
157
Member Avatar for Theanonymous
Member Avatar for Jennifer84

Is the String^::split method available in your API? -- you could split on '\n' and that will fill your array automatically.

Member Avatar for jonsca
0
360
Member Avatar for garber

Thank you for trying with the code tags, but you don't need to tag each line separately. Put all of the code in between a single set of code tags. You have: [icode]retirement = pmt * ((1 + wr)n - 1) / wr);[/icode] Since the computer doesn't understand algebra (unless …

Member Avatar for jonsca
0
153
Member Avatar for HASHMI007

Since you are within a method of the object (set()) you can assign to the private members of the class directly. Get rid of line 34, and insert [code] x = p1; y = p2; [/code] (or just take the values from cin directly into x and y)

Member Avatar for HASHMI007
0
112

The End.