- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 22
- Posts with Upvotes
- 20
- Upvoting Members
- 18
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Married, two kids, two step-kids, house-owner, non-smoker, GSOH. Will write code for food.
- Interests
- Life, death, the usual stuff.
Re: Hi Nathaliecole, It's always worth searching DaniWeb to see whether your question has been asked before. I searched on the phrase "number system converter" and it threw up this thread, which may help you to get started: > i would like to create a program that converts a number system … | |
[B]Intro[/B] This tutorial provides a brief introduction to the random number functions that come as part of the C++ standard library, namely rand() and srand(). [b]rand() and RAND_MAX [/b] The C++ standard library includes a pseudo random number generator for generating random numbers. In order to use it we need … | |
In C++ we provide names for the entities we create, the variables, functions and types in our programs. These names, or identifiers, are required to conform to some simple rules. [b]Valid Characters [/b] An identifier must start with a letter and is comprised of a sequence of letters and digits. … | |
Re: > warning C4700: uninitialized local variable 'n' used line 39 32. int cost[10][10],i,j,k,n,c,visit,visited[10],l,v,count1,vst,p,dup1,dup2; 39. for(i=0;i<n;i++) You're using n in an expression in line 39, for (i=0; i<n; i++), but it hasn't yet been initialised, so it holds an unknown garbage value. When i is compared with n, you're comparing i … | |
Re: "C++ has GUI features" Well, strictly speaking, C++ has no GUI features whatsoever. It knows nothing about such things, they're simply not part of the C++ language or standard library. If your compiler has GUI features (as many do) they're a platform specific extension. For instance MS VC++ comes with … | |
Re: Hi Joe, Fishman has given you some useful code their to get you going. Note that your own code has several basic syntax errors, which indicate that you're probably still at the "hello world" stage. Do you have a C++ book to refer to? If not, can you lay your … | |
Re: Congratulations on having working code. Are you interested in suggestions for possible improvements? | |
Re: > Need help with this and my professor is teaching way too fast. > I really dont understand any of this and my teacher moves to fast to explain things. This is not really a C++ issue, it's a problem you have with your professor. Nothing we do or say … | |
Re: Hi markwiering, I hear where you're coming from. You're still a fairly raw beginner, so for you, having code that appears to work fine when the expected input is provided probably feels like a good result. And in one sense it is. But you can probably understand where the others … | |
Re: Your loop terminates when either of two conditions occurs: the user indicates there are no more items to scan in or the number of items has reached the maximum (100). Within the loop, the user enters the barcode and quantity, the number of items is updated, and if the limit … | |
Re: What part of the task are you having trouble with? Can you write a simple main() function that asks for and stores values for x and n? That'd get you started. | |
Re: Hi orar, Looks like you're uncertain about functions at the moment. Here: void main() { float input(); float calulate(); float output(); }; Several problems. The first is that you should remove the word float from the function call, e.g. calculate(); The second is that the function is supposed to return … | |
Re: Here: *front = entry[i]; this assigns the character at entry[i] to the memory at the address represented by front, but front hasn't been allocated any memory. I suspect what you want is to assign to the pointer the address of the character, like this: front = &entry[i]; The same applies … | |
Re: Hi Nathan Drake, You know what format input to expect, that's pretty well defined for you, so why not figure out how you intend to store it, then how you're going to read it in. That will get you started, at least. | |
Re: In addition to what WaltP said, your compare function isn't working as you expect it to. Take a look at what you're comparing -- DiceTotal and AiDiceTotal -- and check whether this is what you intended. | |
Re: You've obviously done quite a lot of work on this already, but I wondered, given that this is C++, whether you'd considered a more object oriented solution (or is that not a possibility for you)? That aside, and given that you've already implemented a fair amount of this yourself, what … | |
Re: Take another look at this line: cin>>a,b,c; Double-check how to handle multiple values with cin. | |
Re: As an aside, C++11 provides an array class which comes with a lot of functionality, if you have a compiler that supports it. | |
Re: Double-check whether this is doing what you expect it to, keeping in mind how many pennies there are in a shilling. temp.shillings = pe / 20; temp.pence = pe % 12; | |
Re: It's surprising how much information an interviewer can obtain even from an incorrect answer. | |
Re: > Write a function, swapSubtrees, that swaps all of the left and right subtrees of a binary tree. Add this function to the class binaryTreeType and create a program to test this function. This was my assignment this week and I am just at a loss I don't even know … | |
Re: Hi Yusuke00, Can you show us what you have so far in the way of code? Thanks | |
Re: Hi jdadkn, The policy here is that you can obtain help, but you won't get your homework done for you. The point of homework is usually not to provide the solution but to learn from having created one, so you'll need to have a go at this problem yourself first … | |
Re: > Well you all have a point guys, we all wanna help each other and it's up to them if they'll just "copy-paste"..- It's not us they're fooling around but theirselves. Right?! They'd also be fooling their instructor. We help by not short-cutting their learning process, which involves them doing … | |
Re: No specific suggestions, but some general advice: choose a project that really interests you. Motivation is that much greater if you choose something you're interested in, therefore you're much more likely to complete it. | |
Re: You need to include the header for the functions. Try: #include <string.h> | |
Re: In the absence of specific details about what you're trying to do, cin is a perfectly good way to input words in C++. | |
Re: Nothing jumps out at me from the code you've posted, but if I've missed something obvious, someone else will surely point it out. Failing that, and because the actual error could be prior to the source line reporting it, could you post the content of tour.h also? |