2,045 Posted Topics
Re: [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) | |
Re: [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. | |
Re: 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)? | |
Re: [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] … | |
Re: [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. | |
Re: Make some attempt. What you have displayed shows only the most minimal effort. | |
Re: How about Twitter points, too? ;) | |
Re: 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 … | |
Re: [quote]Hope its not a homework>>>[/quote] Homework questions are fine as long as the poster has shown effort. | |
Re: 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 … | |
Re: 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? | |
| |
Re: 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] | |
Re: What are you trying to do? Maybe that will help in showing you a different way. | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: 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) | |
Re: 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. | |
Re: [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 … | |
Re: 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 … | |
Re: 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 … | |
Re: Okay, I'm all done with it. What now? What have you tried at this point? Please post your efforts. | |
Re: 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, … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: [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? | |
Re: [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. | |
Re: 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. | |
Re: 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, … | |
Re: To do that with C++, you need something like libcurl ([url]http://curl.haxx.se/libcurl/[/url]). | |
Re: 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 … | |
Re: 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 … | |
Re: [icode] itsRadius [/icode] is a pointer, you need to dereference it before incrementing it. | |
Re: 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 … | |
Re: 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 … | |
Re: Please show the code where you are resetting it to "". Edit: Try his ^^^^^^ suggestion first. | |
Re: 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. | |
Re: 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 … | |
Re: What language are you trying to do this in? (looks like Matlab to me) | |
Re: [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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
| |
Re: Is the String^::split method available in your API? -- you could split on '\n' and that will fill your array automatically. | |
Re: 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 … | |
![]() | Re: 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) ![]() |
The End.