Posts
 
Reputation
Joined
Last Seen
Ranked #873
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
88% Quality Score
Upvotes Received
8
Posts with Upvotes
8
Upvoting Members
7
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
4 Commented Posts
0 Endorsements
Ranked #1K
~50.6K People Reached
Favorite Forums
Favorite Tags
c++ x 95

68 Posted Topics

Member Avatar for computer engW

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 …

Member Avatar for movies8time8
0
8K
Member Avatar for Mona..

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]?

Member Avatar for Mona..
0
184
Member Avatar for Miyamoto

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 …

Member Avatar for arkoenig
0
980
Member Avatar for sexyzebra19

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 …

Member Avatar for dusktreader
0
154
Member Avatar for rookanga
Member Avatar for wilsonz91
0
151
Member Avatar for Hawkpath

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 …

Member Avatar for Rajesh R Subram
0
159
Member Avatar for alexa868

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): …

Member Avatar for mrnutty
0
360
Member Avatar for astala27

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?

Member Avatar for n1337
0
111
Member Avatar for vileoxidation

[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 …

Member Avatar for vileoxidation
0
206
Member Avatar for programmer01

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, …

Member Avatar for Naira88
0
2K
Member Avatar for kudusan

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 …

Member Avatar for Salem
0
306
Member Avatar for sunveer

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...

Member Avatar for n1337
0
119
Member Avatar for Momar

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 …

Member Avatar for CoolGamer48
0
152
Member Avatar for FTProtocol

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 …

Member Avatar for FTProtocol
0
98
Member Avatar for William Hemsworth

[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 …

Member Avatar for Prabakar
0
159
Member Avatar for Manutebecker

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 …

Member Avatar for VernonDozier
0
112
Member Avatar for masterjiraya

[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 " …

Member Avatar for masterjiraya
0
112
Member Avatar for allena

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 …

Member Avatar for n1337
0
503
Member Avatar for ladyscoleman

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 …

Member Avatar for tesuji
0
134
Member Avatar for mhil_joy

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 …

Member Avatar for Nick Evan
0
103
Member Avatar for xtr.eme

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 …

Member Avatar for Kob0724
0
87
Member Avatar for Alex Edwards

[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 …

Member Avatar for mitrmkar
0
115
Member Avatar for Sukhbir

[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 …

Member Avatar for Alex Edwards
0
4K
Member Avatar for niitian

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 …

Member Avatar for Nick Evan
0
159
Member Avatar for Jboy05
Member Avatar for faust_g

[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 …

Member Avatar for Radical Edward
0
146
Member Avatar for herms14

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 …

Member Avatar for n1337
0
106
Member Avatar for Gagless
Member Avatar for Jennifer84

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]

Member Avatar for mitrmkar
0
299
Member Avatar for Aldayne

[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 …

Member Avatar for Aldayne
0
150
Member Avatar for nlsna17
Member Avatar for Bitto11
0
176
Member Avatar for joshmo

[QUOTE] [code=cpp] while(current->name!=name) { previous=current; current=current->link; } current=current->link; previous=previous->link; delete previous; } [/code][/QUOTE] Can I see your list struct? I think you are losing a pointer in your code though. Before you delete the specified node (the one you want to delete), you need to make sure that the previous …

Member Avatar for joshmo
0
127
Member Avatar for v@$@nt

LIFO. Stack using arrays...? It might be a better exercise to implement a stack struct (that can be easily resized and whatnot). But if you really want...then I guess we could work through one with an array... But first, read about stacks here: [url]http://en.wikipedia.org/wiki/Stack_(data_structure[/url]) Once you understand the data structure, …

Member Avatar for n1337
0
111
Member Avatar for Black Magic

Essentially you are extending the triangular number sequence: 1, 3, 6, 10, 15, ... (i.e. each number is the number of asterisks printed so far). Here is the pattern: [url]http://www.mathematische-basteleien.de/triangularnumber.htm[/url] Using a switch statement would not be very effective if you needed, say, 100 lines (heck even having to make …

Member Avatar for William Hemsworth
0
101
Member Avatar for Triggerhappy41

Pass by reference works much the same as passing an array in Java. In fact, when you supply an array as an argument in Java, you don't actually copy the array, you just pass the address (believe it or not). It's just you don't explicitly manage the pointer aspect in …

Member Avatar for Triggerhappy41
0
145
Member Avatar for Lukezzz

Perhaps you need to update the label text as you update the progress bar value...in the same iteration...

Member Avatar for Lukezzz
0
82
Member Avatar for Cybulski

I'm afraid that, even if you found some function in some library somewhere, it's implementation would still be O(n) (where n is the number of characters)....After all, a string is just an array of characters, and so you would have to see each character to determine if it is a …

Member Avatar for n1337
0
134
Member Avatar for bhoot_jb

I have a potential solution...though you may not like it (and I haven't fully implemented it, so there could be some leaks): 1) In your stack class, in the private field, in the node struct, change T element to be a pointer (i.e. T *element) 2) In the public field …

Member Avatar for bhoot_jb
0
117
Member Avatar for ryanlcs

[QUOTE]But what's the main diff between them?[/QUOTE] The difference is just in the way you are storing them, at the memory level. For example, suppose you had the following memory model: [code] Address Contents ... ... | 200 | | | | 204 | | 15 | | 208 | …

Member Avatar for n1337
0
81
Member Avatar for C-+

[QUOTE=kllera;611706]what if you have to have the two input values as intigers, not allowed to classify them as floating or double? i can change the result classification thu. ..we have to divid two intigers (int) but still get an accurate answer. ex: 10/3, is 3 with int but there should …

Member Avatar for n1337
0
140
Member Avatar for Magic Hands

Seems like an interesting project. I don't actually know anything about this myself, except that you might have to do some hardware interfacing (with the soundcard). This book looks like it has a lot of material on the subject: [url]http://www.pearsonhighered.com/educator/academic/product/0,3110,0201419726,00.html[/url] Other than that, all I can suggest is that you …

Member Avatar for Magic Hands
0
86
Member Avatar for QuantNeeds

[QUOTE=QuantNeeds;611626]the data type is integer but it is not catching decimal numbers. [/QUOTE] Unless I'm missing something, I think you answered your own question here...after all, integers are not real numbers or rational numbers (i.e. no decimals allowed). They are simply all the numbers in the set: {...-3, -2, -1, …

Member Avatar for n1337
0
81
Member Avatar for mghmgh

EDIT: deleted my explanations because I agree with Salem...also, could you try to be a little clearer with your question (I find it difficult to understand). And try some google searches...you can easily find an in-depth explanation of factorial, C++ i/o (reading from the console), etc...

Member Avatar for n1337
0
292
Member Avatar for dan_e6

[QUOTE] It's just another poor example of teachers trying to get students to use recursion. In most cases the solution to the assignment they hand out would be much better suited to a loop, and the result is that kids know [I]how[/I] to use recursion, but don't know [I]when[/I] to …

Member Avatar for n1337
0
465
Member Avatar for usmanabb

OK I did one case for you, hopefully you can derive a more general case from it: EDIT: they trim whitespace so nvm, words will have to do...I had a diagram for you... Ok here we go: A has a 0.5 chance of serving first. If A serves, it has …

Member Avatar for usmanabb
0
721
Member Avatar for blackbeard

[QUOTE]I need to be able to initialize player_position for at least 2 players, have them roll the dice, move the players to a new location and determine whether there’s a snake or ladder there, then move them to a new location. [code] int board[101]; int snake; int ladder; snake = …

Member Avatar for blackbeard
0
1K
Member Avatar for luckystar89

What have you done so far...? What specifically do you need help with? Do you have any thoughts on how to solve the problem? If so describe them...If you have any code, post it so we can see where you are at with the problem. EDIT: lol few seconds behind …

Member Avatar for VernonDozier
0
528
Member Avatar for mertucci

Ummmm what specifically are you having difficulty with? It is pretty much straightforward OOP...classes and inheritance... If you haven't learned the subject, thats another issue entirely, in which case I would suggest doing a google search on C++ classes and inheritance, and then posting back here with more specific issues...

Member Avatar for mertucci
0
179
Member Avatar for mertucci

Again, be specific with the areas of difficulty... An array of strings? My question is, suppose you had the array: { "me", "you", "us" } Does the output need to be reversed like "us", "you", "me" (if so, just start at the last index and move backwards), or "su" "uoy" …

Member Avatar for joshmo
0
95
Member Avatar for aastephen

ummm you could try changing the function to have return type pointer to char... i.e. [code] //in the Person class... [B]char*[/B] personFind(char pid[]); //... [B]char*[/B] Person::personFind(char pid[]) { //code goes here... } [/code] I am also worried that if you end up returning the name, you do not close the …

Member Avatar for n1337
0
120

The End.