Forum: C++ May 8th, 2009 |
| Replies: 6 Views: 373 Yeah, after realizing how tired I was I also realized that I never answered the original question.
the getline function is accepting characters for your string but it doesn't seem like you're... |
Forum: C++ May 8th, 2009 |
| Replies: 6 Views: 373 This may help--
#include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
using namespace std; |
Forum: C++ May 8th, 2009 |
| Replies: 1 Views: 532 Have you done any research on Search Engines and how they are structured?
Do you understand the benefits of using a HashTable for this assignment?
I guess a good start would be to create a... |
Forum: C++ Apr 29th, 2009 |
| Replies: 3 Views: 588 I think it would be more useful if one could pass the string into a method and have it return the number of question-marks found (as an unsigned int, or in extraordinary cases an unsigned long int). |
Forum: Java Apr 29th, 2009 |
| Replies: 10 Views: 763 If you post your files, people will be more willing to help because it gives them time to look at your logic and help you understand which steps to take to complete your project. |
Forum: Java Apr 11th, 2009 |
| Replies: 11 Views: 718 Since any Java-API based class is valid for the assignment....
I suggest inserting the values into a B-Tree (Binary Tree) then printing the objects in the tree via In-order traversal.
import... |
Forum: Java Apr 11th, 2009 |
| Replies: 11 Views: 718 More details are needed.
For example, what type of goal are you trying to achieve? Finding a low-running time way of printing your array or just getting the job done?
The Iterative/Recursive... |
Forum: C++ Nov 29th, 2008 |
| Replies: 6 Views: 401 1) That's me intermingling Java and C++. There's nothing more to say there.
2) Nothing I disagree with, but I tried making a simpler example for the OP to follow. |
Forum: C++ Nov 29th, 2008 |
| Replies: 6 Views: 401 You'd be surprised how much programming and math are related! =)
In fact, before I wanted to program I pursued a math major with more of a background in creative writing. I don't know how but I... |
Forum: C++ Nov 28th, 2008 |
| Replies: 6 Views: 401 Hmm, parameters are typically a part of a method's call argument(s). I'm assuming the assignment requires you to create a method that has a reference parameter and returns the result through the... |
Forum: C++ Nov 28th, 2008 |
| Replies: 8 Views: 748 void TestVector(Vector<double> v)
{
}
int main()
{
Vector<double> pd(5.6,3.4,2.4);
// use the cast operator works if copy ctor is not defined
Vector<float> pf = pd; |
Forum: C++ Nov 27th, 2008 |
| Replies: 9 Views: 549 By no means am I attempting to discredit any Instructor. The assignment is familiar to me - very similar to what I had to do in a C++ class.
-Alex |
Forum: C++ Nov 27th, 2008 |
| Replies: 9 Views: 549 Is your Instructor's name Ron, by chance?
-Alex |
Forum: C++ Nov 27th, 2008 |
| Replies: 6 Views: 2,656 Subtraction is technically the same as adding a negative, so there was no need to add a subtraction operator to the doOperation method. Conversions from subtraction to adding a negative are most... |
Forum: C++ Nov 26th, 2008 |
| Replies: 9 Views: 2,394 You know, I've been wondering about this for awhile now myself.
Honestly you can probably get away with making some kind of regex or key to "compress" files with given values.
For example lets... |
Forum: C++ Nov 25th, 2008 |
| Replies: 5 Views: 694 1) My Answer: Composition ( I believe you meant to say Composition ? ) is a form of delegation in which instances of a class use, but may not have the same interface of a target object.
The major... |
Forum: C++ Nov 22nd, 2008 |
| Replies: 3 Views: 429 There is hope!
Use fmod to resolve the modulus between two doubles
#include <iostream>
using std::cin;
using std::cout; |
Forum: Java Nov 22nd, 2008 |
| Replies: 7 Views: 867 Unfortunately, the implementation of ArrayList<T> looks [something] like this--
//... necessary imports
public class ArrayList<T> extends List<T> implements Collection<T>, Serializable{
... |
Forum: C++ Nov 22nd, 2008 |
| Replies: 5 Views: 1,085 Hmm, try changing char to unsigned (if it exists @_@ )
-Alex
Edit: I am really tired #_#
I didn't realize I made the array back-asswards XD
XP |
Forum: C++ Nov 22nd, 2008 |
| Replies: 5 Views: 1,085 You can use the bool array as a "bit-position" array for the representation of a char.
#include <iostream>
using std::cout;
using std::cin;
using std::endl; |
Forum: Java Nov 22nd, 2008 |
| Replies: 7 Views: 867 You'll probably have to reposition your read-stream cursor after each object read, otherwise you won't retrieve the right byte value from the file to match the data type(s) for the Object you are... |
Forum: Java Nov 22nd, 2008 |
| Replies: 7 Views: 638 I'm not sure how you plan to pause a method from executing instructions within it without somehow pausing (or 'blocking') at a particular line in the method.
If you don't want to use a while loop,... |
Forum: C++ Nov 22nd, 2008 |
| Replies: 4 Views: 469 From what I understand, as long as a file has C++ syntax in it, it can be used as part of a C++ project ( if its a resource file its a different story I suppose, since I haven't really messed around... |
Forum: C++ Nov 21st, 2008 |
| Replies: 9 Views: 511 Ah... I think I'm understanding...
So basically, for an octet byte (8 bits) the table would look something like this...
constant integral types:
(using this list as an example)
-char ... |
Forum: C++ Nov 21st, 2008 |
| Replies: 9 Views: 511 I'd like to know how the types are defined based on the platform.
I have heard that in C++ a char is always 1 byte and an integer is always 4 bytes on any machine, despite how many bits are... |
Forum: C++ Nov 21st, 2008 |
| Replies: 9 Views: 511 In C++, where are the header files that define the standard primitives and bitfields?
I would like to confirm something, if it is possible.
-Alex |
Forum: Geeks' Lounge Nov 21st, 2008 |
| Replies: 40 Views: 4,394 Oddly enough, your avatar scares me... @_@ |
Forum: Geeks' Lounge Nov 20th, 2008 |
| Replies: 28 Views: 1,996 I have said this before, but...
From the gas station... White chocolate, cheesecake, rootbeer, 1/2 shot Latte O_O
From Starbucks, typically a White-chocolate mocha along with a butter-horn.
... |
Forum: C++ Nov 20th, 2008 |
| Replies: 2 Views: 301 That means you are literally treating something that isn't an lValue as an lValue.
For example if a method doesn't return a reference to something, its possible that attempting to treat the method... |
Forum: C++ Nov 20th, 2008 |
| Replies: 14 Views: 1,116 Rep-worthy! XD
It's too bad I can't give you any more rep today @_@
-Alex |
Forum: Java Nov 20th, 2008 |
| Replies: 11 Views: 1,198 If there is already a class available that can search through all of the files on your System, why not make a Decorator class or a class that Maps files (or file names) to a number, and if the file... |
Forum: C++ Nov 20th, 2008 |
| Replies: 14 Views: 1,116 I don't know why... but I found the first post amusing XD
But I'm laughing with you Beast! I promise! O_O
-Alex |
Forum: C++ Nov 20th, 2008 |
| Replies: 3 Views: 306 If you have a finite number of values and they aren't going to change, you can get away with using a standard array instead of a vector.
This is only if you have a static amount of values and... |
Forum: C++ Nov 20th, 2008 |
| Replies: 3 Views: 293 The error codes are usually self explanatory, though with Dev-Cpp that can be a different story since the IDE is currently 'dead' (it works, but it is old and I believe it only deals with gcc and old... |
Forum: C++ Nov 20th, 2008 |
| Replies: 3 Views: 446 void delNeg(node * L)
{
node *cur = L; // cur points to accepted pointer
node *prev = NULL; // prev points to NULL
while(cur != NULL) // while cur doesn't point to NULL
{... |
Forum: Java Nov 18th, 2008 |
| Replies: 10 Views: 5,120 Implemented Right-to-left evaluations for powers. Negatives were improved (slightly) by making negatives parse as multiplying -1 by the value.
import java.util.*;
import java.io.*;
import... |
Forum: C++ Nov 18th, 2008 |
| Replies: 6 Views: 554 Use stringstream if you want to append values to a string buffer on one line then extract the string later.
#include <iostream>
#include <sstream>
#include <string>
using... |
Forum: C++ Nov 18th, 2008 |
| Replies: 4 Views: 368 I tried this (using MS Visual C++ 2005/2008) and it managed to work--
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
using std::flush; |
Forum: C++ Nov 17th, 2008 |
| Replies: 3 Views: 373 If possible, please post the solution. |
Forum: C++ Nov 17th, 2008 |
| Replies: 4 Views: 909 |