Forum: C++ 1 Hour Ago |
| Replies: 5 Views: 55 You're going to have to clarify. Do you have some executable program, originally written in C++, that you want to run at, say 2 p.m.? All sorts of languages can be used to cause this to happen, not... |
Forum: DaniWeb Community Feedback 1 Hour Ago |
| Replies: 5 Views: 163 That's the main problem, I think. I'm not crazy about the syntax-defaulting the way it is now, but since I know about it, I can get around it when I want to. However, the code syntax defaulting has... |
Forum: C++ 8 Hours Ago |
| Replies: 7 Views: 90 Runs fine for me using 1235 and 3459 as input. They're sum buddies and are reported as such. What input is not working for you? |
Forum: C++ 20 Hours Ago |
| Replies: 8 Views: 120 The devil is in the details and you have dots there so it's unclear whether there is some sort of pattern. You have this line in a previous post:
Replacing "A" with "test",
You say id has... |
Forum: C++ 22 Hours Ago |
| Replies: 8 Views: 120 I'll reiterate what I said in my last post. The code is not going to compile with terms like A[0].b in it and it has nothing to do with whether you use if-statements or switch statements. A is a... |
Forum: C++ 1 Day Ago |
| Replies: 13 Views: 288 If you can get it to work without a function, it's a matter of converting that code so that it's inside of a function. Post the code that works where it's all in main. |
Forum: C++ 1 Day Ago |
| Replies: 17 Views: 210 That's what "return" does. It takes you back to main, to the place right after where you called the medic function, which puts you back in the main function. So if the person enters 2 in the medic... |
Forum: C++ 1 Day Ago |
| Replies: 17 Views: 210 Do NOT call the main() function. If you want to repeat, your program should look something like this (starting at line 61):
do
{
// display user's options
// ask user to input option.
... |
Forum: C++ 1 Day Ago |
| Replies: 3 Views: 82 http://www.cplusplus.com/reference/clibrary/cstdlib/system/
"system" is in cstdlib, not iostream.
But you're right. That's not the problem. You need to proofread your posts. The error isn't... |
Forum: C++ 1 Day Ago |
| Replies: 17 Views: 210 Lines 20, 88. Arrays already are passed by reference. Get rid of the ampersand:
void medic(int & money, int & potionsize[5]);
Delete the ampersand in red above on line 20 and on line 88.... |
Forum: C++ 1 Day Ago |
| Replies: 3 Views: 82 If you use "system", you should import cstdlib, because that's the library "system" is from.
But don't use system ("PAUSE") anyway. Use cin.get() once or twice instead.
... |
Forum: C++ 1 Day Ago |
| Replies: 2 Views: 61 I think you need to give an example. What's idnum? How does one determine yearbirth from idnum? idnum is an int. There's no "int" class, so the dot operator won't work.
idnum.subint (0,2);
... |
Forum: C++ 1 Day Ago |
| Replies: 8 Views: 120 You should replace A with test everywhere inside your function body. A is a type. test is the variable itself. test is an array, not A. You cannot dereference A with the [] operator because... |
Forum: C++ 1 Day Ago |
| Replies: 3 Views: 100 // outline
// #include statements here
// #define statements here
// global variables here
// function declarations here
int main (int argc, char* argv[])
{ |
Forum: C++ 1 Day Ago |
| Replies: 6 Views: 137 Looks good to me. Try it out. Does it work? |
Forum: C++ 1 Day Ago |
| Replies: 1 Views: 80 I'm not sure than sum[] array is initialized except for index 0. also, there is no call to srand, so I imagine you'd get the same results every time. You need to initialize the sum[] array before... |
Forum: C++ 1 Day Ago |
| Replies: 6 Views: 137 #include <iostream>
using namespace std;
int main()
{
int TESTS = 0;
int testScore[TESTS];
int testNum = 0;
int a;
double total = 0; |
Forum: C++ 3 Days Ago |
| Replies: 3 Views: 146 a, b, and c. What's the difference between "set" and "store and set"? I assume you want the normal "set" and "get" function for each of the three private variables. So at minimum, three private... |
Forum: Java 3 Days Ago |
| Replies: 2 Views: 153 One, code tags. Use them.
// paste code goes here
Two, Where's the error and what is it? Point out a line number. |
Forum: C++ 3 Days Ago |
| Replies: 4 Views: 130 |
Forum: C++ 3 Days Ago |
| Replies: 4 Views: 130 Common problem when mixing >> and getline. You need to flush the input stream before the getline command to get rid of the pesky '\n' left by the >> operator. See the ignore page from cin, and see... |
Forum: C++ 4 Days Ago |
| Replies: 13 Views: 288 You're simply merging two files that are ALREADY in order into one output file. Hence only very minimal storage is required (one value from each input file), so vectors are overkill. Have two... |
Forum: C++ 4 Days Ago |
| Replies: 10 Views: 296 That's what I don't understand. Seeding seems necessary to me here. Isn't it necessary to seed the random number generator if you want good results? |
Forum: C++ 5 Days Ago |
| Replies: 10 Views: 296 I'm intrigued. Why would you consider not seeding the RNG here? |
Forum: C++ 5 Days Ago |
| Replies: 4 Views: 165 These lines are not being skipped. The Fahrenheit values are 32 larger than the Celsius values, which suggests that at least part of the equation is working. Comment the lines out and pick a... |
Forum: Java 5 Days Ago |
| Replies: 6 Views: 179 Code tags are simply this.
// paste code here
You had it close on your first post. |
Forum: Java 5 Days Ago |
| Replies: 6 Views: 179 Here's your code, formatted and in code tags:
//This is an inventory program that stores
//and lists the inventory of Coaxial Connector-fittings
//Author:
//Class: IT215
//Date: October 17,... |
Forum: Geeks' Lounge 6 Days Ago |
| Replies: 15 Views: 490 Five down votes on this one? Seems a bit extreme. As Best Jew points out, probably not the best forum to post on with this question, but it's still a reasonable question. But not knowing you and... |
Forum: C++ 6 Days Ago |
| Replies: 5 Views: 188 This is what I've been harping on since the major change-over at Daniweb. Java code is now flagged as C++ code instead of plain-old code if you don't specify Java-specific code tags. It... |
Forum: C++ 7 Days Ago |
| Replies: 8 Views: 210 Here's what I think you should do. Don't worry for now about why/how the code did what it did (obviously, you can and probably should go over it later and figure out what it does and why for your... |
Forum: C++ 7 Days Ago |
| Replies: 9 Views: 183 I don't know if this pseudo-code or real code, but if it's real code, line 14 is going to cause you problems. A function call needs parameters. Based on your function prototype, you need at least 3... |
Forum: C++ 7 Days Ago |
| Replies: 9 Views: 183 These are separate, independent tasks, so tackle them separately and independently. Have two functions, "Flip" and "Reverse". Both involve swapping values, so you'll need to write a "Swap"... |
Forum: C++ 7 Days Ago |
| Replies: 8 Views: 210 If I recall correctly (from a previous thread), the OP also wants each punctuation element to be in its own vector (OP, please clarify), so if the string was "dressed(with))", the OP wants this:
... |
Forum: C++ 8 Days Ago |
| Replies: 16 Views: 293 Write a << operator. In line 52, you use the [] operator, so you have the ability to isolate the individual elements of list. Loop through the elements in list, isolate an element, then display... |
Forum: C++ 8 Days Ago |
| Replies: 11 Views: 338 Here's the example from http://www.cplusplus.com/reference/clibrary/cstring/strtok/
modified to work with "Bob's".
/* strtok example */
#include <stdio.h>
#include <string.h> |
Forum: C++ 8 Days Ago |
| Replies: 11 Views: 338 Having a vector of vectors of char seems needlessly complex to me. A single vector of strings would be better, I think. If that's what you're doing, then where does the "/*" and "*/" come into... |
Forum: C++ 8 Days Ago |
| Replies: 16 Views: 293 Did you even bother to compile this before posting it? Even a cursory look at it makes it obvious that it won't compile. Look at line 179 for instance. There is no "actual output" because this... |
Forum: C++ 9 Days Ago |
| Replies: 11 Views: 338 Lines 32 through 54 - What are you trying to accomplish here? Lines 34, 38, 42 are the same test over and over again. Why test for the exact same thing every time through the loop? Just test it... |
Forum: C++ 9 Days Ago |
| Replies: 11 Views: 338 Is this a code parser? I see you are looking for "/*" and "*/", which are comment delimiters. if not, what is the significance of the tests on lines 29 through 33? Since whitespace is a delimiter... |
Forum: C++ 9 Days Ago |
| Replies: 11 Views: 338 Look at ispunct and strtok. I imagine that'd be your best bet. Your delimiters are a character array of all punctuation. Read in using the >> operator to throw out white space, then split the... |