- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 7
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Re: Or else you do a few math calculations, then set up a function to draw individual shapes.... For example, you could create a "square" function: [code=cpp] void draw_square(int sideLength); [/code] which basically loops and outputs a square (of the specified size, using a loop) to the screen... Advantage: you can … | |
Re: Perhaps these questions will help lead you to the answer... What is obj.A? What is *(obj.A)? How is this different from (obj.A)[0]? What is **(obj.A)? How is this different from (obj.A)[0][0]? | |
Re: Order notation is just like a simplified mathematical expression. O(n), or order-n, is like saying that the runtime is "linear", or roughly proportional to n (which could be the length of a list, the depth of a tree, the number of characters in an input, etc). We use order notation … | |
Re: In general, matrices do not need to be square in order to compute their product... rather in computing A*B, the number of columns in matrix A must be equal to the number of rows in matrix B. Regardless... We can think of each matrix as being composed of row and … | |
Re: A [URL="http://en.wikipedia.org/wiki/Flowchart"]starting place[/URL]. | |
Re: After lots of use you will tend to remember the syntax, even if when starting out you just copy and paste code. I suppose the most important thing is understanding... That is, understanding all of the components and program flow so that you can build on basic templates (provided for … | |
Re: What about a taylor series approximation... The theory is rooted in calculus, but you can probably manage by simply applying the formulae and ignoring the theory (FYI series and taylor approximations are typically covered in a Calc 2 course). Here are the approximations (scroll down to the "series definition" section): … | |
Re: Let me try to understand here... The function needs to return a that represents a binary integer? Or the actual bits of the returned value need to be the correct binary representation of the decimal value? | |
Re: [QUOTE=vileoxidation;1043270]But it is not working. I get an error when I run the procedure, which says this: "string-append: expects type <string> as 2nd argument, given: #<void>; other arguments were: """ What am I doing wrong here? [/QUOTE] The issue is that your char_toupper function actually returns void... In fact, the … | |
Re: I haven't read your code, but I would guess that you are not tokenizing properly... I would take a finite state machine (FSM) approach to solving this problem...reading in input character by character, and calling routines based on the input...(somewhat of a C influence I suppose). With that in mind, … | |
Re: There are also tons of tutorials on the subject, for both openGL and DirectX. I really suggest that you search for them on google, and if you're serious, then possibly even get a book on the subject, because some of the topics in 3D graphics and game programming are considerably … | |
Re: Do you mean you need to print the LU factorization of the matrix? if so, perhaps [URL="http://en.wikipedia.org/wiki/LU_decomposition"]this[/URL] page might be of some assistance... | |
Re: Well, if you want to get technical, it has to do with how you are referencing each object at the memory level (and understanding of this depends on how much you know about memory models). Additionally, I think the pointer information is declared on the heap, vs your second declaration … | |
Re: Since Addition is a boolean value, you could also simply code: [code=cpp]if (Addition) { //do whatever }[/code] That is of course unless you are attempting to make the boolean value true...which would defeat the purpose of checking it in the conditional statement in the first place... Note: You have similar … | |
Re: [QUOTE=Shaun32887;635457]Well not ALL, just every integer up to that numbers square root. :)[/QUOTE] Yes, Shaun is correct. However there is more...A related theorem says that every number is either prime itself, or else is a product of primes. I forget who proved this (Euclid?) but here is a proof (I … | |
Re: yup yup of course in that case, if you ever computed a sum of 12 (two 6's), numInstances[sum] would actually be out of bounds (no error though, so be careful). So...you would have to store it in array index sum-1 in this case. Also remember that numInstances[0] would actually never … | |
Re: [QUOTE]can you do something about it? [/QUOTE] Well, you could do something about it... In your for loop, do something like: [code=cpp] if (i%5000 == 0) { end = clock(); runningTime = (double) (end - start) / (double) CLOCKS_PER_SEC; cout << i << endl << "the running time is " … | |
Re: Well...those links have a lot of the differences. I think basically C++ is an extension of C with added features. You can still use C code in C++, and code in a "C-Style", but C++ has features that do away with some C stuff. In terms of abstraction from the … | |
Re: What have you tried so far? Any thoughts on the subject? Do you know how to declar a multidimensional array, or a single-dimensional array for that matter? Do you know what a conditional (if) statement is (or what a switch statement is)? Do you have any code attempts written (if … | |
Re: OK that is a really open ended question...Before I (or anyone else) can even begin to help, we need to know a few things: 1) When you say user to user, do you mean like across a network? On the Internet? On the same computer? 2) Do you want to … | |
Re: You know, it seems that introducing GUIs to the beginner programmer is a little bit like opening pandora's box. I mean, I'm not saying that in doing so we release all the evils of programming... It just seems to me that when you are new to a language or programming … | |
Re: [QUOTE=Alex Edwards;630433]If anyone has a good book suggestion, or site where I can get some practice/advice on memory management I would really be grateful. I'd hate to be one of those problem-programmers that cause the dreaded memory leaks in team-projects.[/QUOTE] I literally googled "C++ memory management" and here is what … | |
Re: [QUOTE=Alex Edwards;630240]You could also use a HashMap which is built for indexing, but I cannot explain that well enough to give a valid example.[/QUOTE] A Hashmap is basically a combination of an array and a list: Suppose you had a whole bunch of keys. The way a hashmap works is … | |
Re: The key to these and all problems is to not get overwhelmed...break it down into steps, solve first one step, then continually add more functionality.... So first we need to think about how we can keep track of the customers, both male and female, and in what queue they are … | |
Re: ummm did you see the date? and it was already solved... | |
Re: [QUOTE] vector< <vector<string> > 2dVectorOfStrings; [/QUOTE] I do believe it is just: [code=cpp]vector <vector<string>> myvec;[/code] [QUOTE]How you would size the inner vectors to 10 strings each and the vector of vectors to 10 inner vectors of 10 each would be pure conjecture[/QUOTE] You could do something like this: [code=cpp] vector … | |
Re: I think you generate 100 random numbers in the range 1 to 200, and store them in an array. Then you do 100 searches, each time generating a new random number, and using this newly generated random number to check if it is in the array (of random numbers created … | |
Re: C# and C++ have very similar syntax (C# came after, and is based on Java and by extention C++). C# was designed around the .NET framework (which I actually really like, from what I remember)... This might be helpful... [url]http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=542964&SiteID=1[/url] | |
Re: [QUOTE]I am having a problem because what i am doing is not related to the class.[/QUOTE] What do you mean? What specifically are you having difficulty with...Also, does your code compile? If not, where are the issues... [QUOTE]Take a look at the code below please and give me some suggestions … |