2,827 Posted Topics
Re: That's a lot of code and your question only pertains to a very small portion of the code (or at least it will if the code is designed well). You're going to have to point us in the right direction and ask something far more specific. Somewhere in there you … | |
Re: I think you are either naming things with non-descriptive names or you don't understand some concepts. Normally a getMean or getStandardDeviation function will look like this: [code] public static double getSD (int array[]) { double sd; // fill in sd here using array[] return sd; } public static double getMean … | |
Re: [QUOTE=themarval;1140166]please review my code to let me know what I'm doing wrong here. I'm building a function that will return a specific value if the parameter is of a specific type. How would i proceed with assigning a specific return value for each parameter type? I've managed to compile and … | |
Re: Don't do the requirements in order. You should zoom in on requirement 9 (print all the entries so far). This will help you in debugging. Don't waste time searching and sorting until you know for sure that the adding and displaying is working. Garbage in, garbage out. If it isn't … | |
Re: I think AD is referring to scasb, not scansb? I get way more hits on scasb. Frankly, I had never heard of either of them, but you could fit what I know about Assembly in a test tube and still have room for several cc's of blood. Here's a thread … | |
Re: Not sure I understand the algorithm. "hello all" turns into "ifllp bmm". Is that a mistake? Is it supposed to be: "ifmmp bmm"? Add one to each letter? | |
Re: It's sort of difficult to help without knowing what you intend the overall design to be. It's hard to suggest an overall design without knowing the requirements. At minimum, post what the program should prompt the user, the user's input, and the desired output for that input. In addition, we … | |
Re: Dave Sinkula had the answer a while ago, I think. Give rep UP TO your rep power. If you're Ancient Dragon and you want to neg rep someone without destroying them, give them neg rep of however much you feel is appropriate. Ditto for positive rep. I use the up/down … | |
Re: [QUOTE=MosaicFuneral;1108580]Then going ballistic over some cryptic letters and numbers on a scope(2COR4:6, JN8:12) does seem the obvious reaction, somehow.[/QUOTE] Damn right we should be going ballistic over this. It plays right into jihadist propaganda that this is all a Christian Crusade against Islam. These aren't "cryptic" letters and numbers. They're … | |
Re: [QUOTE=i_luv_c++;1133760]hey guys thakns for all the help:) i have a question about the nest?? if i use this code(code below >>>)..do i need to use only swap statement or do i need to use swap for each if statement??? and along with that when i tried to see compare d … | |
I'm relearning (OK, "learning" would be a better term since I never really understood it the first time) piping. My end goal is to execute some shell commands like "ls", get the results into another variable, and do some stuff with it. I imagine I'll end up using commands like … | |
Re: [QUOTE=StuXYZ;786240] You also violate the precidence rules, the tip, is 15% of the (subTotal+totalTax). [/QUOTE] I don't think there's a hard and fast rule, but I think generally you base the tip on the pre-tax amount, though internet research finds pages recommending both ways, with a majority recommending basing the … | |
Re: [QUOTE=niek_e;1113350]So today I was driving my car to work and I see an old man fall of his bicycle. Thinking that he might have a heartattack or something I quickly pulled over the car to help him. I had to jump a small ditch to get to him. When I … | |
Re: When you are debugging, use fewer numbers and make them non-random. Solve a problem at a time, then go back to the real assignment. You say you are having a problem casting numbers. What line number and what is the problem? Have a short array like {1,2,3,4,5}, where you can … | |
Re: My passwords are so good/random/meaningless ("ert34W89P") that even I can't remember them. That's why I keep them all in a binder on my desk labeled "Passwords". Apparently this is extremely common. | |
Re: You have this posted as a code snippet, but it looks like a regular forum thread (snippets are when you don't need help and you know how to do something and want to share your code with others). I don't know what the "size 2 3" part has to do … | |
Re: [QUOTE=scholar;698202]Hi, I am using a 16-bit compliler and i wanted to execute a dos commmand through c++ using system() command.I wrote the following code but it didn't help #include<process.h> void main() { system("c:\\windows\\system32\\Notepad"); } I even tried wid 'system("notepad")' but even tht didn't run the command.Plz tell me if i … | |
Re: [code] int ThingYesNo; doubleThingHeight do { cout <<"Does the thing exist?"<<endl;//d11 cout << "1) Yes" <<endl; cout << "0) No" <<endl; cin>>ThingYesNo; if (ThingYesNo==0) break; else {cout << "What is the Things Height?"<<endl; cin>>ThingHeight; } }while (ThingYesNo !=1); // ThingHeight and ThingYesNo are available here. You can use them. cout … | |
Re: Line 25: [code] scores[10] = Float.parseFloat(tests); [/code] Look closely at the part before the equals sign, decide what you are trying to do, and see if this line does what you want it to do. | |
Re: I can't run it since I don't have the file, but the lack of an assignment operator seems possibly problematic to me, particularly since you are using C-style strings, which are just pointers. Put some debugging statements around lines 118 to 120 to verify that: [LIST=1] [*]There is an attempt … | |
Re: Code tags: [noparse] [code] // code here [/code] [/noparse] Whenever you mix getlines an the >> operator, you have to be very careful that >> doesn't leave a '\n' in the stream, so you need to flush the stdin stream. I'm guessing that's your culprit. [url]http://www.daniweb.com/forums/thread90228.html[/url] | |
Re: What is the problem? Does it not compile? Compile but crash when your run it? Run successfully but give bad results? If so, what are the results? | |
Re: [QUOTE=Dave Sinkula;1116549]I'm just curious -- [B]how long would it take someone to find the snippet I had in mind armed with the information I provided in this thread?[/B] [LIST] [*]How many tries at search terms and other things to narrow it down does it take you? [*]Did you use the … | |
Re: [QUOTE=rusydi_10;1116487]Write a program for multiplication and division of two numbers for different base number. Programme structure: The program should contain 1. Should have an infinite loop which is the program is always running. 2. An option for a user to select base number of the first number. (For example: base … | |
Re: [QUOTE=Fbody;1116016]WTF are you trying to accomplish? All I'm seeing is a bunch of screwing around to assign an input to an array element. Why not just run a loop through 10 iterations and assign the input to the specific element based on the current value of the iteration control variable. … | |
I have some code to parse POST and GET parameters passed to a CGI program written in C and I'd like to test it out. To parse GET parameters, I need to access the QUERY_STRING environment variable, so I'd like to set that environment variable to different things and see … | |
Re: m /(22) =d; d/(8) = h; These don't work. You need a single variable on the left. Do whatever algebra you need to to accomplish this: m =d * 22; d = h * 8; or if you are trying to do an assignment to d and h, switch sides: … | |
Re: I would step back from the actual implementation and look at you algorithm. Whatever your algorithm is, it isn't obvious to me. Why bother with pointers at all? The [] operator works like a pointer in your case and it makes it easier to read. Lines 32 and 33 is … | |
Re: This isn't a code snippet. It's a regular thread. You may have accidentally checked something and called it a snippet. It's being treated as an OR. Your description of what it is doing makes it SOUND like it IS treating it as an OR. Your description makes it sound like … | |
Re: [QUOTE=kaninelupus;932799] Most haven't even got a clue of how their own parliamentary system even works [/QUOTE] The reason we don't understand how our own parliamentary system works is because we don't have one. | |
Re: Even if someone were to try to help you without demanding effort on your part, they couldn't write what you are asking anyway. What kind of SQL database? Anyone writing this would need to know what type of database you were connecting to (Oracle, MySQL, etc.). They would need to … | |
Re: [url]http://www.cplusplus.com/doc/tutorial/program_structure/[/url] From this link: [quote] int main () This line corresponds to the beginning of the definition of the main function. The main function is the point by where all C++ programs start their execution, independently of its location within the source code. It does not matter whether there are … | |
Re: > Ok, I got the assignment from my CompSci teacher to write a program that converts a string of an infix operation to a postfix one and it has to use a list and stack. The class that we have to write, Postfix, has to include a conversion, parsing, clear, … | |
Re: If you do not know the size ahead of time, you can use the MAXIMUM size to make sure you have now overflow. There is no maximum size for this. There's a maximum number of columns, but not a maximum number of rows. So you are left with a few … | |
Re: Regarding the password masking with asterisks, yes it is doable (we've all seen it), but the question is "Can it be done using only the standard libraries?" I don't know the answer to that, but googling "C++ password masking" yields some good threads and the answers tend to lean towards … | |
I have a very simple shell script to stop the Apache server: [code] #!/bin/bash sudo /usr/sbin/httpd -k stop [/code] I named it "StopApache.sh". When I run it from the command line, it stops Apache. However, when I double click the "StopApache.sh" icon on the Desktop, I'm asked whether I want … | |
Re: [QUOTE=firstPerson;1033889] Instead of spending millions of dollars on (fill in blank) we could be helping people like this.[/QUOTE] Of all the stupid, inane things we waste time and money on that you could fill in the blank above which offer little positive value to humanity (unnecessary war, Jerry Springer, mindless, … | |
Re: [QUOTE=musicthingz;1091152]Does anyone know how to select multiple products for duplication , adding and deleting - instead of having to do it one by one which doesn't work in my store of 3500 products. I'm trying to duplicate mass products and then delete the older product - to essentially alter it's … | |
Re: An orpaned case is a case statement that doesn't have a switch statement that it's a part of. You very likely have a brackets problem in case 192. Go through case 192 and make sure that you have the same number of opening and closing brackets. Below would be an … | |
Re: [QUOTE=Justin12345;697607]This is what I got so far and I am really stuck dont know where to go ... this is a beginners class so it has to be simple didnt learn much so far. This is what I got.........Using netbeans.... dont know where else to go to get outputs like … | |
Re: [QUOTE=eduard77;1088008]Hello I am really new in c++ but I read a lot of books. But I haven't found in any book how to add an interface to my program. So, what is necessary that the program to not run in the windows console?[/QUOTE] Define "interface". Do you mean an "interface" … | |
Re: [QUOTE=eduard77;1087991]Why do I have a syntax error in this line ? I think that everything is correct fMaxElem = fabs(double pfMatr[k*nDim + k] , int k); // error C2059: syntax error : ')' m = k; for(i=k+1; i<nDim; i++) { if(fMaxElem < fabs( double pfMatr[i*nDim + k], int k) )//error … | |
Re: [QUOTE=firstPerson;1084729]>> assuming I understand them Yes, but instead of asking the user for the number N; N has to be the sum from 2^0 -> 2^50. I though the instructions were clear enough, especially with the examples.[/QUOTE] I think it would be clearer if you stated that what is to … | |
Re: [QUOTE=9122080;1083576]The main programm is to permit input of a text of arbitrary length,the number os special frequencies of vowels must be counted. Output: Frequency of each english vowel(aeiou) ignoring the cases(i.e case insensitive) ignoring special vowels in other languages,depending on the following occurences: vowels in monosyllabic words vowels in two-syllable … | |
Re: I assume you are using Linux? The program will run in Linux if you double-click it, but you may not get a console window. For example: [code] #include <iostream> #include <fstream> using namespace std; int main () { ofstream outs; outs.open ("HelloWorld.txt"); outs << "Hello World"; outs.close (); cout << … | |
Re: [QUOTE=alizee67;1083125]Hey guys! I have an assignment for Tuesday. The problem is: Write a program, getting n (odd, n>=1 && n<=15) from the user and prints this shape: For n=3 [B][URL="http://i50.tinypic.com/25ria7c.jpg"]PLZ Click here to see the image[/URL].[/B] I wrote this code, but I don't know what to do with [B]line #13[/B]. … | |
Re: I don't think it's currently possible, but it seems feasible and it would be a great idea. | |
Re: Sounds similar to what I noticed a few weeks ago. I posted the thread below regarding it. [url]http://www.daniweb.com/forums/thread239829.html[/url] | |
Re: The stream will fail on line 37 if something that is not a digit or a minus sign (or possibly a decimal? Can't remember) is entered. Once the cin stream is in a failed state, if you do not clear it, it will remain in a failed state. If the … | |
Re: [QUOTE=Ancient Dragon;1075422]You shouldn't feel so bad If you do the math, 72/968 = 6%, not 34%[/QUOTE] But if you do the math this way: [code=text] 776 / (776 + 1481) = 34% [/code] So that works for you at least...but not other people. Reverse-engineering a formula might be an interesting … ![]() |
The End.