2,045 Posted Topics
Re: Where is the code for the overloaded operator? Please make some attempt at that code and post back. | |
Re: The first few errors are due to the fact that you don't have a constructor that takes an argument. In [I]addition[/I] to what you have: You need a constructor that takes an int argument. (in your class declaration): [icode] MyStack(int sz); [/icode] and defined as: [code] MyStack<T>::MyStack(int sz) { top=-1; … | |
Re: [quote]What is the partations of c++?[/quote] Please clarify what you mean by "partations". [quote]What kind of programmes I can built with?[/quote] Go through some open source projects and see what languages they use. Something like [URL="http://en.wikipedia.org/wiki/Category:Free_software_programmed_in_C%2B%2B"]this[/URL] can give you some idea [quote]And why it's the best programming languages?[/quote] That's a … | |
Re: Go to the designer and select your form. Go over to the properties window and select the lightning bolt (to get the events). Find "Form closing" (not "Form closed") and double click the cell to the right of it. This will put the event handler code into your Form1.h and … | |
Re: You are trying to read "RXBytes" into one character (since you are using %c and rec is just a character). I would read the whole line in using fgets and copy out/parse the portions that you need based on the fact that your have an equals sign, followed by a … | |
Re: Line 28: [code]newNodePtr->pengarang = pengarang;[/code] You are only copying the pointer over, not the contents of the string. Use [icode] strcpy(newNodePtr->pengarang,pengarang);[/icode] instead (or better, since you don't know how large your source string is, use [URL="http://www.cplusplus.com/reference/clibrary/cstring/strncpy/"]strncpy[/URL]). | |
![]() | Re: Those sorts of low-level direct I/O calls (in the spirit of inp()/outp()) no longer work under Windows (as of NT and later) without a special device driver. For an alternative look into the Win32 API functions like [URL="http://msdn.microsoft.com/en-us/library/aa363858(v=vs.85).aspx"]CreateFile[/URL]. See [URL="http://www.robbayer.com/files/serial-win.pdf"]this PDF[/URL] as the author seems to go through those functions … ![]() |
Re: What was the code that you were using for the bubble sort, and where did you place it? | |
Re: I ran it through a couple of times: [code] Is the ohm a decimal? Enter Y : y Please enter 0 first then the decimal point. (Ex. 0.1) Please enter the desired resistance value in ohms (0.01 ohms to 100,000,000 ohms): 1.0 Please enter the desired tolerance as a percentage(5, … | |
Re: Not to interject now that this is solved, but give chapter 35 of the C++ FAQ (particularly [URL="http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12"]question 12[/URL] a read. It's one of the clearer explanations I've run across. | |
Re: Hint: "one" is at position 0 of the Manta array, "two" is at position 1, etc. | |
Re: I would just eliminate that parameter, as you are creating a new ifstream object within the body of the method anyway. You may want to rethink your implementation a bit, because all you are doing is writing to the same int value over and over again, and that int is … | |
Re: Have a look at [URL="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4411BBFC-0E3C-42B3-BD05-AF1D292C986F"]this[/URL] (there's a nicer version for VS 2010, it's probably virtually the same set of keybindings). | |
Re: On line 64, you are attempting to parse the data without having any data yet. Put your getline statement first (before your parsing statement), then put a statement to split your string in two (into first and last), and then finally call [icode] parse2() [/icode]. | |
Re: Posting your question on multiple sites is inconsiderate. | |
Re: I have a question as to why you are displaying in your add method. Your add method should do nothing more than add the two numbers together. You may want to check with your specification to make sure that your code is not supposed to add the two together and … | |
Re: [quote]Why not declare a string empty val and input it in between t[lcv] and Z[lcv] to achieve the spacing? [/quote] The extraction operator (>>) takes input delimited on spaces. The way the OP has it is fine. | |
Re: [QUOTE=frogboy77]The money's not the best [/QUOTE] Everybody always says that, but they forget that there are just so many perqs beyond the salary (not to mention all the book deals and speaking engagements afterwards are probably enough to keep them afloat). I'll bet the president doesn't pay for internet and … | |
Re: Use an ifstream object and the extraction operator >> to get the values. As you read them in, loop over the members of your array and write them in. Take another shot at it and post back if you are still having trouble. | |
Re: Have you tried compiling it? There's quite a few syntactical liberties in there. :) [code]char[]* LongArr;[/code] is not valid syntax. Where does numStr in the constructor come from? Where does i come from in [icode] getInt() [/icode]? [code]new int* int1[/code] new doesn't belong on the left side of that expression … | |
Re: [quote]C# is foor n00bs[/quote] Be sure and let [URL="http://stackoverflow.com/users/22656/jon-skeet"]him[/URL] know that. ;) | |
Re: [code]char *text;[/code] You have an uninitialized pointer here, and a few lines down, you try to store something in it. Allocated memory for your C-string using new. Why do you close the file before you open it in the beginning of the code? | |
Re: You need to be much more specific about your requirements before anyone can even begin to help you. Since you only have 1 week, you're going to have to be conservative about your goals, as some of these libraries take months to learn. | |
Re: Did your instructor go over passing parameters by reference. You need those techniques in this case. For instance, the getName signature would look like: [code] void getName (string & firstName, string & lastName) [/code] Otherwise, you are just passing in copies of those variables, the changes are being made, and … | |
Re: [quote]When I want z value to write in Textbox form window.[/quote] That doesn't happen by magic. Go through [url]http://www.functionx.com/vccli/general/introprogramming.htm[/url] which will tell you a little about accessing GUI elements. You'll have to make sure you have the right kind of project selected (winforms). In addition, the syntax of the (loose) … | |
Re: [QUOTE=cse.avinash;1530546]Sir, you can check the link:- [url]http://www.spoj.pl/problems/SIZECON/[/url][/QUOTE] (I'm going to weigh in, even though I probably shouldn't) OP, what you have written is not legal syntax, it doesn't compile, and either you misunderstood the solution explained to you or the person explaining it to you had no idea what they … | |
Re: Try starting a new project and copying and pasting the code from the existing one into the new one. | |
Re: [quote]Better you must read it properly.... [/quote] Better you reread the thread because you don't seem to understand the clear explanation that Narue was giving about undefined behavior. | |
Re: In readFile, first you use std::string and then you use C-strings. You should pick one and be consistent. If your concern is getline there is a version that is a member method of istream ([url]http://www.cplusplus.com/reference/iostream/istream/getline/[/url]). Also, line 35 will not work. | |
| |
Re: College seemed tough at the time, and in many ways I wouldn't want some of that pressure back, but really I'd give anything to be back to the good times. I'll take the wisdom I've gained in the (runs hand over my mouth to conceal the number) years since I've … | |
Re: Check out Curl (standalone program) and libcurl (C library which has C++ wrappers) [url]http://curl.haxx.se/[/url] However, you can interact with a database directly from your C++ code (using whatever bindings your database has, or a generic ODBC driver), so there's no need to interact through the web server. | |
Re: By virtue of C# being the more prevalent .NET language, most of the tutorials don't use the C++/CLI syntax. You're better off looking at a C# site like [url]http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSectionID=167[/url] and trying to translate the syntax (sticking in :: and -> when needed). | |
Re: What /clr setting do you have set for the compilation? If you don't have any on there, it will try to compile your code as native. | |
Re: [quote] I'm not familiar with C#[/quote] All you have to remember is that C# used '.' for both namespaces (which would use '::' in C++) and member variables/methods (which would use either '.' or -> to access a class/struct depending on whether the variable is a pointer or not). I … | |
Re: Where is the code for UpperCaseFilter and EncryptionFilter? | |
Re: Do you know how to do all of the transformations from a mathematical standpoint (i.e., pencil and paper)? If not, first start with a good reference book or Wikipedia article and figure out the mechanics of it. | |
Re: Put it in a file named something like "ParseBBCode.h". Include that header in your Form1.h file (or put it in stdafx.h, but that's not necessary). You do not need to include <string>, the String ^ in this case is a System::String^ from .NET. You will either need to put a … | |
Re: At least show us something you've started. You have the pseudocode there, now try and transform as much of it as you can into actual C++ code. | |
Re: Sure, someone will be glad to help, but please make some attempt at those two functions. No one is going to write it for you. I know you said you "messed up," but that's what we need to see to get you going in the right direction. Start with the … | |
Re: [quote]is it possible?[/quote] Yes. I'm assuming you're using C++/CLI with Winforms? Place your images in a [icode]List<Bitmap>[/icode] and make a "surrogate" array of integers from 0 to 15. Use a [URL="http://en.wikipedia.org/wiki/Knuth_shuffle"]Fisher-Yates shuffle[/URL] on that array of integers. Display the items of the list in the order that is defined by … | |
Re: You need a loop. The way your function is situated now, you call it by passing in the array without knowing how many members it has,which doesn't actually matter because you're printing out the first element, incrementing i and then returning. "i" is not maintained between calls, so you're starting … | |
Re: I'm assuming that you're working in C++/CLI since you are doing WinForms. Check out the [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx"]BackgroundWorker[/URL], as I believe that's the most straightforward way of getting a separate thread (and I believe it was designed for exactly this purpose, i.e. for separating the GUI and the meat of the code). … | |
Re: [quote]i can just include a welcome speech at the end of my post.[/quote] Put it in your signature. "If you're new, welcome, if you're returning, welcome back, and if you're here all the time, you're WaltP" :) | |
Re: [quote]I am not for sure if addresses.push_back(ads);, in the code below, will make the above possible. [/quote] Can you clarify what you mean by this? Your code is confusing because you have [icode]ads.push_back(name);[/icode] and then [icode] addresses.push_back(names);[/icode]. Did you mean names instead of ads in the first part? It seems … | |
Re: [quote]giving a vertex on a 2D plane[/quote] What information do you have about the plane? (equations, points, etc?) [URL="http://en.wikipedia.org/wiki/Surface_normal"]This[/URL] does a nice job of explaining things. | |
Re: Grab #7 (it's free and legal) from [url]http://www.qtrac.eu/marksummerfield.html[/url]. #6 is the current edition, but I don't know how much that is. The book takes you through making a rudimentary spreadsheet within the first few chapters. It also goes on to talk about the other aspects of the library like the … | |
Re: Make a list for yourself of precisely what is confusing about those topics, for example [code] Typecasting: Is it necessary to cast my variable when I am doing XYZ Twos compliment: How do I handle negative numbers [/code] etc. Now you have a list of things you can search other … |
The End.