2,827 Posted Topics

Member Avatar for jimJohnson

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 …

Member Avatar for VernonDozier
0
479
Member Avatar for Destiny1

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 …

Member Avatar for mkurdukar
0
506
Member Avatar for themarval

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

Member Avatar for jonsca
0
172
Member Avatar for smokin745

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 …

Member Avatar for BestJewSinceJC
0
164
Member Avatar for NathanOliver

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 …

Member Avatar for Ancient Dragon
0
149
Member Avatar for isralruval

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?

Member Avatar for VernonDozier
0
70
Member Avatar for habibalbi

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 …

Member Avatar for VernonDozier
0
169
Member Avatar for darkagn

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 …

Member Avatar for Ancient Dragon
0
469
Member Avatar for lrh9

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

Member Avatar for jwenting
1
768
Member Avatar for i_luv_c++

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

Member Avatar for i_luv_c++
0
149
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
141
Member Avatar for cassie_sanford

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

Member Avatar for Fbody
0
411
Member Avatar for Nick Evan

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

Member Avatar for apegram
0
294
Member Avatar for ppotter3

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 …

Member Avatar for ppotter3
0
1K
Member Avatar for Salem

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.

Member Avatar for PedroStephano
0
707
Member Avatar for Mz3g

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 …

Member Avatar for Mz3g
0
363
Member Avatar for scholar

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

Member Avatar for WaltP
0
248
Member Avatar for lsandling

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

Member Avatar for lsandling
0
118
Member Avatar for Bemani_lover

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.

Member Avatar for peter_budo
0
144
Member Avatar for atticusr5

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 …

Member Avatar for atticusr5
0
108
Member Avatar for d2dupes

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]

Member Avatar for VernonDozier
0
77
Member Avatar for Katherine692008

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?

Member Avatar for Jhonjay123
0
777
Member Avatar for Dave Sinkula

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

Member Avatar for VernonDozier
0
247
Member Avatar for rusydi_10

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

Member Avatar for dusktreader
-3
112
Member Avatar for macman101

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

Member Avatar for ChaseVoid
0
180
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
847
Member Avatar for blueman:-0

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

Member Avatar for mrnutty
0
184
Member Avatar for gillanism

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 …

Member Avatar for gillanism
0
118
Member Avatar for perroned

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 …

Member Avatar for perroned
0
108
Member Avatar for PetuniaRose

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

Member Avatar for Ene Uran
0
969
Member Avatar for deepak17

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 …

Member Avatar for peter_budo
-1
79
Member Avatar for wolfkrug

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

Member Avatar for wolfkrug
1
178
Member Avatar for gramatton

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

Member Avatar for joseph111
0
141
Member Avatar for ms_farenheit1

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 …

Member Avatar for DavidB
0
3K
Member Avatar for pcpp

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 …

Member Avatar for VernonDozier
0
107
Member Avatar for VernonDozier

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 …

Member Avatar for jolies2
0
184
Member Avatar for mrnutty

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

Member Avatar for VernonDozier
-1
269
Member Avatar for musicthingz

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

Member Avatar for Ancient Dragon
0
118
Member Avatar for countercoder

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 …

Member Avatar for lieni
0
2K
Member Avatar for Justin12345

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

Member Avatar for aladar04
0
504
Member Avatar for eduard77

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

Member Avatar for eduard77
0
202
Member Avatar for eduard77

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

Member Avatar for VernonDozier
0
60
Member Avatar for mrnutty

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

Member Avatar for mrnutty
0
148
Member Avatar for 9122080

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

Member Avatar for VernonDozier
-1
115
Member Avatar for discovery-power

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

Member Avatar for discovery-power
0
114
Member Avatar for alizee67

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

Member Avatar for VernonDozier
0
104
Member Avatar for FlashCreations

I don't think it's currently possible, but it seems feasible and it would be a great idea.

Member Avatar for Ancient Dragon
0
139
Member Avatar for William Hemsworth

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]

Member Avatar for William Hemsworth
0
185
Member Avatar for samsons17

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 …

Member Avatar for VernonDozier
0
182
Member Avatar for anonymous alias

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

Member Avatar for diafol
-2
414

The End.