527 Posted Topics

Member Avatar for Sky Diploma

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

Member Avatar for lqdo
0
358
Member Avatar for geek-girl

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? [ICODE] The Iterative/Recursive approach T, V, E, D, A, B T is found V is found, V should be printed …

Member Avatar for BestJewSinceJC
0
165
Member Avatar for brizwhiz

Please use code tags... //place code statements within brackets "["code=java"]" // insert code here... "["code"]" Get rid of the quotes when doing this

Member Avatar for BestJewSinceJC
0
1K
Member Avatar for dmanw100

This approach was probably unnecessary, but I took it anyways. Try this-- [code=java] import java.io.*; public class DataInputFilterStream extends FilterInputStream{ public DataInputFilterStream(InputStream is){ super(new DataInputStream(is)); } @Override public int read() throws IOException{ skip(available()); return (available() == 0) ? super.read() : 0; } public char readChar() throws IOException{ return (char)read(); } …

Member Avatar for stephen84s
0
377
Member Avatar for caps_lock

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 is encountered again, replace the value with an incremented form …

Member Avatar for jbennet
0
257
Member Avatar for sillyboy

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. And of course I always pay the maker of the coffee to drink it (if they start making weird faces about it …

Member Avatar for brandmantra
0
272
Member Avatar for Alex Edwards

Hey everyone! =) I'm starting an Application Development club at my college! However, there are a fair amount of programmers with multiple backgrounds who want to be a part of the club and partake in some of the Software we will create. Most of the people who are joining the …

Member Avatar for iluxa
0
334
Member Avatar for christina>you

Since Christmas is coming up, I suppose I'll revive this thread =) And Christmas is nice! I always get what I want... ...a day off =P -Alex

Member Avatar for techbound
0
484
Member Avatar for Ancient Dragon

Here's an idea... Instead of buying Vista, wait until 2011 for [URL="http://en.wikipedia.org/wiki/Windows_7"]Windows 7[/URL] I'd rather wait 3-5 years for a new OS than invest in one that will become yesterdays news fairly soon.

Member Avatar for Jen0608
3
400
Member Avatar for xandres

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

Member Avatar for xandres
0
202
Member Avatar for Awaivadrailla

Most of your statements were so brilliant, I couldn't understand them! "[I]Shizah[/I] happens!" @_@ This is what I believe (in my honest opinion)- The entire world is going through a recession (and soon a depression). Many companies are going to take advantage of the banks' decisions of supplying more money …

Member Avatar for jbennet
0
166
Member Avatar for knharp3

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 reference parameter, and not through a return value from the function call? Correct me if I'm wrong. -Alex

Member Avatar for ArkM
0
139
Member Avatar for cristinel

[code=c++] 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; // use the copy ctor works if cast operator is not defined TestVector(pd); } [/code] In the above example, Vector<float> pf = pd …

Member Avatar for cristinel
0
186
Member Avatar for SlayerX

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 say you have a text document and it is set up something like this-- [icode] // …

Member Avatar for Salem
-1
321
Member Avatar for n8thatsme
Member Avatar for Jason123

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 benefit of Composition? There are many. Let's say you need to …

Member Avatar for Alex Edwards
0
795
Member Avatar for BestJewSinceJC

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, you can make a conditional clause where the loop sends its data to a …

Member Avatar for BestJewSinceJC
0
93
Member Avatar for Fouly

There is hope! Use fmod to resolve the modulus between two doubles [code=c++] #include <iostream> using std::cin; using std::cout; using std::endl; int main(){ double x = fmod(4.5, 3.22); cout << x << endl; // 1 R 1.28, so 1.28 should print out cin.get(); return 0; } [/code]

Member Avatar for Fouly
0
158
Member Avatar for TimothyKhoo

[QUOTE=TimothyKhoo;696207]no....i really need help here... i just duuno what to respond better than that....i knw this is just an easy stuff for you guys out there....but i am ashame with myself cause i cant even face it...i cant even do own part as a trainee...how the hell am i going …

Member Avatar for TimothyKhoo
-1
138
Member Avatar for AutoC

You can use the bool array as a "bit-position" array for the representation of a char. [code=c++] #include <iostream> using std::cout; using std::cin; using std::endl; int main(){ bool bits[] = {0, 1, 0, 0, 0, 0, 0, 1}; char c = 0; for(int i = 0; i < 8; i++) …

Member Avatar for AutoC
0
4K
Member Avatar for Alex Edwards

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

Member Avatar for ArkM
0
189
Member Avatar for CoolGamer48
Re: hpp?

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 with those @_@). For example, the iostream header …

Member Avatar for ArkM
0
139
Member Avatar for TheBeast32

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

Member Avatar for William Hemsworth
0
181
Member Avatar for MJFiggs

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 as an lvalue wont work since you're returning a copy of the actual object in which that …

Member Avatar for MJFiggs
0
164
Member Avatar for starletcharmed

[icode] 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 { if(cur->info < 0) // if the member (of the object on top of the …

Member Avatar for cikara21
0
101
Member Avatar for NewGuyCPP

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 MingW compilers). Use Code::Blocks or Microsoft Visual C++ 2008 Express edition (recommended). …

Member Avatar for cikara21
0
118
Member Avatar for burhanms

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 performance is an issue. If performance doesn't matter, use a vector …

Member Avatar for MosaicFuneral
0
99
Member Avatar for DefConBandit

[QUOTE=DJSponge;711675]Thanks to you both, I began a Python tutorial this weekend and so far I love it. "Hello World!" lol[/QUOTE] Yes, another person who is entertained, and not aggravated, by programming! =) Always keep that perspective, no matter how hard it is to learn something! You'll find programming very fulfilling! …

Member Avatar for punjabivirsa3
0
183
Member Avatar for NEEDJAVA

Ok, where is the confusion really? An API that specialized in SMTP and POP3 or the concept of SMTP and POP3 protocols? -Alex

Member Avatar for Antenka
0
369
Member Avatar for manzoor

I tried this (using MS Visual C++ 2005/2008) and it managed to work-- [code=c++] #include <iostream> using std::cout; using std::cin; using std::endl; using std::flush; int main(){ char str1[] = "Hello"; char* str2 = str1; str1[0] = 'M'; cout << str2 << endl; cin.ignore(); cin.get(); return 0; } [/code] -- however …

Member Avatar for mujash.techee
0
130
Member Avatar for Lokolo

Use stringstream if you want to append values to a string buffer on one line then extract the string later. [code=c++] #include <iostream> #include <sstream> #include <string> using std::stringstream; using std::string; using std::cout; using std::cin; using std::endl; using std::flush; int main(){ stringstream ss (stringstream::in | stringstream::out); string testing = "testing!"; …

Member Avatar for Alex Edwards
0
190
Member Avatar for skatamatic
Member Avatar for JustLearning

[QUOTE=james_zheng;737344]you need to have the concept of 'object oriented programing' . [B]A behavior(function) is belong to a object, it can not exist seprately[/B]. just like a hand can not do anything if it is not a part of a body.... Thinking in this way you 'll get the idea. if …

Member Avatar for JustLearning
0
192
Member Avatar for minas1
Member Avatar for gammavn

Post the code please. I can see a few ways around this but it might be better to have a sense of the intent of the program before making a suggestion.

Member Avatar for vijayan121
0
189
Member Avatar for midimatt

You could also make a Menu class to encapsulate the banking operation. However, it might be better to specialize your Menu and give it a name (and make an 'abstract' base class Menu for general Menu's ). -Alex

Member Avatar for ithelp
0
145
Member Avatar for PaladinHammer

You may want to consider this process-- -Pull in lines from target read file and store them in a stack<string> -pop strings from stack and write them to file That's if the strings need to be listed in reverse order. If you have to reverse the strings and list them …

Member Avatar for PaladinHammer
0
232
Member Avatar for delner

Assumed solution-- [code=c++] #define Class class class Link; class Room; Class Space { //... }; Class Room : public Space { Link* l; //... }; Class Link : public Space { Room* r; //... }; [/code]

Member Avatar for Alex Edwards
0
74
Member Avatar for harishasan

Why not just create your own implementation of FTP by using Sockets and sending a collection of bytes from one application to another then have the receiving application write those bytes to a File (or FileDescriptor object if that is possible). Edit: Here's an Open-Source API that seems promising - …

Member Avatar for angelfires
0
133
Member Avatar for BestJewSinceJC

[QUOTE=BestJewSinceJC;731485]Is there any way that I can take a String and somehow use it as if its the name of one of my declared Objects? For example, if I have an Animal named germanShephard, is there some way I could say String gerSh = "germanShephard"; and then treat gerSh as …

Member Avatar for ~s.o.s~
0
199
Member Avatar for Achupa

Chances are likely that your Instructor wishes for both your getArms and getLegs methods to return an array of Limbs-- [code=java] Arm[] getArms(){ return arms; } Leg[] getLegs(){ return legs; } [/code] -- however, something about the assignment suggests that your Human class doesn't simply hold an array of 2 …

Member Avatar for stultuske
0
833
Member Avatar for JustLearning

It might help if you explain what your Graph-class is supposed to do. By the way, what is your constructor definition supposed to do? You assign numV to be 0 then you de-reference an uninitialized array of vertices. You probably meant to do something like this-- [code=c++] Graph::Graph(int num) : …

Member Avatar for JustLearning
0
370
Member Avatar for bugmenot

[URL="http://www.daniweb.com/forums/thread90228.html"]Read Narue's post[/URL] Also, it may be more beneficial for you to ignore a specified amount of characters or ignore characters until a specified delimiter is met-- [code=c++] #include <iostream> using std::cin; //... int main(){ //... cin.ignore(INT_MAX, '\n'); return 0; } [/code] If you put cin in an error-state, you …

Member Avatar for Lerner
0
140
Member Avatar for Ancient Dragon

Speaking of pizza, it's time to order one! =) Hmmm... let's see... I typically only order pizza with Pepperoni, Italian Sausage and rarely will I go for Supreme @_@ What are some other fairly good toppings (for pan-crust pizzas)? =) -Alex

Member Avatar for Alex Edwards
1
211
Member Avatar for sagar_d
Re: hi

I tried to remake the program and provide examples in an attempt to reproduce the problem on Microsoft Visual C++ 2005/2008 compiler, but I different errors than the one I expected despite the tests-- [URL="http://groups.google.com/group/comp.lang.c++/browse_thread/thread/165fd677062f0d13"]Similar Problem here[/URL] [code=c++] /** * Assumed header file for LogBuffer */ #ifndef LOGBUFFER_H #define LOGBUFFER_H …

Member Avatar for Alex Edwards
0
102
Member Avatar for jayjaysam0441

You can probably get away with using one method, recursively until it resolves to an absolute base case. I'm sure you can because I remember someone asking this same exact question, except they had to use recursion. They eventually found a solution.

Member Avatar for Alex Edwards
0
207
Member Avatar for Fiery Demon

Please use code-tags and proper indentation. I believe you meant to close your while loop and your run method before overriding paint-- [code=java] import java.awt.*; import java.applet.*; /* Part 0, CSC104 Assignment 2 Fall 08 * Where is Wall-e? */ public class Part5 extends Applet implements Runnable{ private Location ovalOffset; …

Member Avatar for VernonDozier
0
123
Member Avatar for thegodfather96

Check out the stickies in this forum. You should get a lot of good references from them. -Alex

Member Avatar for Alex Edwards
0
54
Member Avatar for Alex Edwards

I remade an equation-solver program from Java to C++, and I plan to post it soon but I would rather not until I can determine where modulus fits in with PEMDAS. To those who don't know, PEMDAS is the order in which mathematical expressions are to be evaluated. The order …

Member Avatar for Alex Edwards
0
7K
Member Avatar for britto

This should be an easy project, until you have to create a command for executing an applet instead of a standalone application. Also executing packaged-classes might be a bit tricky. It will help if you ran some batch files (or possibly even shells for a UNIX box) to see what …

Member Avatar for stultuske
0
167

The End.