2,827 Posted Topics
Re: >> what is the best Torrent program I like uTorrent and bittorent. The best torrent program is a completely separate issue from pirating/copyrighting. There are plenty of artists/developers who WANT their stuff out there for free and uTorrent and bittorrent and the filesharing sites are a God-Send. With them, there's … | |
Re: The first step is to get the non-varying "variables" out of there. [code] int fun(int n) { if(n>2000) return n-40; if(n<=2000) return fun(50+fun(50+fun(50+fun(50+n)))); }[/code] Second step is to simplify it by getting rid of the second if. [code] int fun(int n) { if(n>2000) { return n-40; } return fun(50+fun(50+fun(50+fun(50+n)))); }[/code] … | |
Re: >> How can I send an email through C++. You don't. Or at least you don't through standard C++. You need to either use something like libcurl and pass this information to some language like PHP which DOES have built-in mail functionality or you need to find some other C++ … | |
Re: >> you have to go through the tedious process of clicking on every paeg in your contact list and find him. You have too many friends. Me? It's Saturday night, I'm ready to party, so I just got out my cell phone and started dialing people up seeing who wanted … | |
Re: >> But some people and scientist said that he should be given a proper burial and respected by the west. Who said that? Respected by the west? I don't think so. Supposedly they did give him a "proper" burial. The extra bonus is that since he's buried at sea, the … | |
Re: >> but it seems to be working only in int and char data type num1 is uninitialized so it could be anything, which means score could be anything. It shouldn't work at all, whether you're using floats, ints, chars, whatever. [quote] [code] //if num and num1 is a digit, continue … | |
OK, the eventual goal of my project is a kind of word insert/delete/replace. You read a file... "The quick brown fox jumps over the lazy dog." and you can delete all instances of "fox", replace "fox" with "cat", insert "giraffe" wherever you want, etc. Word processing stuff. So I figured … | |
Re: Your code formatted. [code] //SimpleLinkedList.h #include <iostream> using namespace std; struct Node { char cvalue; double dvalue; int keyvalue; Node *next; }; //SimpleLinkedList.cpp #include "SimplelinkedListLab_2.h" class SimpleLinkedList { private: Node *first; // This is the only member variable your are allowed! public: SimpleLinkedList(); // Default constructor ~SimpleLinkedList(); // Destructor must … | |
I've done Hello World programs with Visual C++ Express 2010 before, but I always checked the "Empty Project" option. This time I selected a Console project and took the defaults. Program is below. [code] // HelloWorld.cpp : Defines the entry point for the console application. // using namespace std; #include … | |
Re: 1. I'll skip 1 except to say the totally meaningless "it depends". Hopefully someone else will jump in with something smarter. 2. >> Do I need to concern myself with how sstream works inwardly or can I just learn it's funcionality and forget it? Learn the functionality first, then worry … | |
Re: [QUOTE=Ancient Dragon;]someone deliberately shot him in the head.[/QUOTE] That someone was the U.S. Military. | |
Re: You're either calculating tax, printing a list, or sorting, but not all three at the same time. They are three distinct tasks and should be handled as such. Combine them at your own peril. Aside from that, I see no attempt at a bubble sort anywhere, so I have no … | |
Re: Before one adds a term, one must find out whether said term exists. If so, replace. If not, add. So first iterate through all the terms and look for the exponent. If it exists, that's the easy case. Replace the coefficient and you're done. If not, add the term. First, … | |
Re: Line 3 - [ICODE]char name[20];[/ICODE] Perfectly acceptable, but you're using C++, so if there is not a reason not to, take advantage of the string class. [code] string name; [/code] You might perhaps want to keep track of last and first name since that is how the file is organized. … | |
Re: >> My program "works", except it's bad style and I need to be using .at I don't know what the style problem would be nor how using "at" would help. >> I need to be using .at, because the way I have it now doesn't account for extra whitespace etc. … | |
Re: Several things can go wrong in a program. Among them... [LIST=1] [*]Functions are incorrect. [*]Function parameter passing is incorrect. [*]Something is wrong in the calling function. [/LIST] There are other things that can go wrong, but let's concentrate on these three. When something goes wrong, you want to narrow it … | |
Re: They're so hard to rate. First you have to agree on who's qualified to rate them, then you have to agree on some criteria. As the ratings show, depending on who you ask and what the criteria are, you can get some dramatically different tables. However, good old Abe Lincoln … | |
Re: I imagine you're looking at something multi-threaded or multi-processed and non-portable. What's your background on that? Lots of good threads out there, including this one. [url]http://www.daniweb.com/software-development/cpp/threads/105105[/url] I think the technique will depend on the OS, your exact needs, and your experience level. | |
Re: The psudocode just confuses me. Perhaps post the "before" and "after" of the file and what's changing? Is this something like you're "setting" bit 2 of the SOT portion of the file to 1? you need to traverse the file, find "SOT", then find the "bit 2", then find the … | |
Re: [code] public void decrementHours() { hr--; if(hr< 23) hr = 23; } public void decrementMinutes() { min--; if(min < 59) { min = 0; decrementHours(); } } public void decrementSeconds() { sec--; if(sec < 59) { sec = 0; decrementMinutes(); } }[/code] The logic of all 3 of these look … | |
I am trying to work on a project for school from home. The school computer has Oracle and I am trying to access it from home using Java/JSP. Currently I have Java SE with NetBeans installed on my home machine (Windows XP SP II), but not Tomcat or Oracle. The … | |
Re: >> I want int previous_pick_3_numbers[20]={to read from file} I'm seeing way more than 20 numbers in this file. You want to read the whole file or just the first 20 numbers? Do you know for a fact that the array will be exactly 20 integers in length at compile time? … | |
Re: >> Hello all, I will be placing my source code onto pastebin and making it private as I am scared of my fellow students stealing my hard work for this class. Sort of defeats the purpose of the forum if... [LIST=1] [*]You don't post the code here. [*]You make it … | |
Re: I voted "Don't Know, Don't Care" just because it was the closest, but it's really "Don't Know" for me. I do care. | |
Re: Line 16 is missing an equals sign... [code] int previous_pick_3_numbers[20] ={346,794,861,529,347,925,196,969,243,837,740,025,822,809,454,843,942,510,573,346};[/code] Line 32 is a function inside of another function. You can't do that in C++. Try moving line 32 to line 10. With those two errors, the compiler will get confused and give you hundreds of errors that aren't … | |
Re: I don't think it has anything to do with user input. The algorithm itself is flawed, recursion or no recursion. It immediately flunks for a non-recursive example. One disk, three pegs. One move from either peg 0 to peg 2 or peg 1 to peg 3, depending on how you're … | |
Re: [LIST=1] [*]If it's a 7 x 7 array, your indexes should be 0,1,2,3,4,5,6. You use array index 7 in line 3. That's out of bounds. [*]What do you mean "return"? Is this a function? [/LIST] | |
Re: Regardless of anything else, the whole thing breaks the first time you hit line 84 as far as I can tell. What's st[0]? Is st an array? If so, you never set aside any memory for it, or at least not soon enough. >> This line(cd=new CD[putCount() + 1])... Does … | |
Re: I question the wisdom of using [ICODE]while(cin)[/ICODE] as a sentinel representing "finished entering data". That might work just fine for a file, but this isn't a file. An example of how things should end up in the array after everything is done, given certain user input, might be in order, … | |
Re: royng, According to your profile, you're in HIGH SCHOOL, not even college. You don't have any business voting in this poll since you have nothing to compare school to. Personally, I HATED high school, but it had nothing to do with the assignments being hard. It was all the other … | |
Re: First off there is a class called File, so rename your Formatter and Scanner objects something else. It's too confusing. Second, make life easy for yourself and create a text file with a text editor and have Jave READ the file (as opposed to writing it), so dump the first … | |
Re: >> the first line contain number of expressions to parse and the following lines contain the expression that i would take it character by character . how can i do this ??? How can you do WHAT? Parse how? What are the criteria? What happens upon parsing? Some calculations? Some … | |
Re: I don't know where the errors are but they can't be lines 14 and 38 because those are blank. You need to indent so the code is readable. You also need to post the exact error messages and the correct line numbers. | |
Re: [QUOTE=MSoft;1542486] please help me guys!!!:'([/QUOTE] This is unproductive and inappropriate for a professional forum. It only serves to flag you as someone who is not serious. Without much more specificity on your part, these generic links are the only links anyone can give you. [url]http://download.oracle.com/javase/tutorial/[/url] [url]http://download.oracle.com/javase/6/docs/api/[/url] | |
Re: I am interpreting the goal as follows. Please confirm whether my understanding is accurate. You have ten items. Each item has four data points. High numbers are "good". Low numbers are "bad". Increasing numbers are "good", decreasing numbers are "bad". So "memory" has the trend you are looking for. Things … | |
Re: I have 3. I might consider tying you with 4, but not until one of the options is split into two. I may or may not be guilty of both, but I'll only admit to being guilty of one. | |
![]() | Re: >> I seem to remember a while ago there were a selection of certs that you could choose. Still are. See attachment. You have a variety of options. I suggest picking one that looks really good to the outside world like the number of Solved Posts and leaves all the … |
Here's a simple, though not the most efficient, program that flags and displays all prime numbers less than or equal to 1000. | |
![]() | Re: From Wikipedia (red emphasis added by me)... [quote] In cryptography, the one-time pad (OTP) is a type of encryption, which has been proven to be impossible to crack if used correctly. Each bit or character from the plaintext is encrypted by a modular addition with a bit or character from … |
Re: Line 11 doesn't make much sense to me. col is 1 and never changes. That means the "loop" will only happen once, so not much of a loop. qu is always 0. Therefore I am quite surprised by this statement... [quote] The function I wrote below works for col 1, … | |
Re: I assume this is you? [url]http://stackoverflow.com/questions/5697296/c-value-initialization[/url] Stack Overflow or here, but not both. Your question has already been answered over there apparently, but we'd have no way of knowing it. Cross posting is a big no-no. | |
Re: Line 1 - aPoint is never used. Line 1 - Unless you intend to call a copy constructor, stick an & in there. A "const" or maybe even two might be appropriate as well. Those would be IMPROVEMENTS, but are not the actual problem. Lines 4 and 5 - invokeX, … | |
Re: >> I have no idea what should I do (noob alert)... A quick inspection of the output shows three things. [LIST=1] [*]Pre-sort results match the expected results. [*]Post-sort results do not. [*]Pre-sort and post-sort results are identical. [/LIST] Therefore...your sort doesn't work. Two possibilities. [LIST=1] [*]Sort doesn't work inside the … | |
Re: [QUOTE=stephenk291;]however lets say out of 8/10 games the user has won 6 so therefore the user cannot come back to win the most games or tie so the game should end before the 10 limit.[/QUOTE] Can you rephrase this? I for one don't understand what you mean here. | |
Re: [LIST=1] [*]We don't know what you understand and what you don't. [*]Line 20. I as the user obviously typed in something wrong. Perhaps give me a hint on where I screwed up so I won't do it again? Might not be necessary. The hint/instructions are on lines 10 to 12. … | |
Re: All signs point to a bad input stream. You should test that it in fact opens correctly and that it's "good". [url]http://www.cplusplus.com/reference/iostream/fstream/is_open/[/url] [url]http://www.cplusplus.com/reference/iostream/ios/good/[/url] You should also make sure that it's actually reading things in. Quick way to do this is to initialize your array to some nonsense value like -999999999. … | |
Re: [code] for (int lcv = 0; lcv < 1000; lcv++) fin >> y[lcv]>> x[lcv]; [/code] Lines 7 and 8 above won't work. That's for a known-ahead-of-time data size. You DO NOT know ahead of time how much data you'll have, so you need to read something in, then check it. … | |
The End.