527 Posted Topics

Member Avatar for snoh7

You could just create your own collection-type, such as a linked list or a tree, to store your information. Edit: Also I think a StringBuffer is backed by an array for random-access character retrieval.

Member Avatar for snoh7
0
143
Member Avatar for Mooonky

[QUOTE=snoh7;711317]Mooky, how did you go finishing this Hangman project? If you have a working completed one would u be able to send it to me at SNIPPED. I have an assignment due that very closely resembles your hangman and am in need of help[/QUOTE] If you look very carefully, the …

Member Avatar for snoh7
0
1K
Member Avatar for mrrko

Hmm something looks fishy here... [code=c++] for (int n = 3; n <= 100; n++) { for (int i = 2; n < i; ++i) { newn = n % i; while(newn > 0) { cout << n << " "; } } } [/code] In the above chunk of …

Member Avatar for VernonDozier
0
155
Member Avatar for mathrules

Just a note... I can already see some problems... You're not implementing the <string> header... On one of your later lines you're using something along the lines of... [code=c++]cin << value[/code] ...and that just wont work. Also please use proper indentation and code tags, or others may not be so …

Member Avatar for mathrules
0
129
Member Avatar for abelingaw
Member Avatar for volscolts16

Anything Java can do, C++ can do (though there may be more instructions). In fact, C++ can do more than Java.... However when it comes to GUI implementations, C++ loses out unless you count .NET Frameworks and other non-standard libraries that support GUI application development under the C++ language. I …

Member Avatar for volscolts16
0
106
Member Avatar for Alex Edwards

My computer keeps restarting whenever I do something like view a stream-video or also do something else that is video related, i.e. playing Warcraft 3 FT. Sure it can perform fine doing either task (for about 5 minutes) but then the computer just shuts off without warning! Now at first …

Member Avatar for OlyComputers
0
97
Member Avatar for Jennifer84

Correct me if I'm wrong, but doesn't the cavet ^ symbol in C++.NET mean that the type is actually a pointer? [code=c++]List1.Add(Vec1());[/code] looks fishy... Vec1 is a pointer-type, so doesn't that mean you need to call gcnew to properly instantiate that Vec? O_O [code=c++]List1.Add(gcnew Vec1());[/code] I'd assume.

Member Avatar for Jennifer84
0
169
Member Avatar for Alex Edwards

I had a hard time understanding the concept of memory in a computer, but something my Instructor told me gave me some hope. He mentioned that memory isn't really created upon invocation of "new" in C++, and stated also that memory isn't really removed upon the invocation of "delete." I …

Member Avatar for skatamatic
0
169
Member Avatar for Alex Edwards

I typically don't post anything unless I have a question or comment... but I am still trying to understand Serialization for Network-Applications and I ran into a brick wall (repeatedly) during a project that required sending and receiving chunks of data from one Client to another. Be aware of using …

1
80
Member Avatar for redflame777

Though Stephen has already pointed this out, you need to get rid of the access modifiers when declaring data types in your main method. The reason is because it is irrelevant for a method to have access specifiers within its scope when you are declaring local variables that will not …

Member Avatar for redflame777
0
106
Member Avatar for orangejuice2005

I believe Masijade had something like this in mind, though I could be a bit off-- [code=java] import java.io.*; import java.util.ArrayList; public class Driver { //--------------------------------------------------< main >--------// public static void main (String[] args) { //array to hold data //String[] Data = new String[0]; Driver D = new Driver(); System.out.println(D.loader().toString()); …

Member Avatar for orangejuice2005
0
264
Member Avatar for boncher

Without looking at the code... I must ask... is it truly required for both vectors to be of the same type ( <string> ) to complete the assignment? Your if statement will almost always evaluate to be true because you're using the single = (assignment) operator as opposed to the …

Member Avatar for ArkM
0
112
Member Avatar for SonxQ7

Yes, the fact that you can store items that aren't what other programmers may expect when handling the data. That and most likely issues in memory, though I can't confirm this. The only reason raw types are allowed is for compatibility between legacy versions of Java (before Erasure types) and …

Member Avatar for vite
0
190
Member Avatar for charusood
Member Avatar for Lerner
0
284
Member Avatar for DemonGal711

I had to edit what you posted... the indentation got to me-- [code=c++] #include <iostream> #include <fstream> #include <string> #include <cstring> #include <sstream> using namespace std; void getfile (ifstream&); void input (ifstream&, int&, string*); void write (int, string*, int*, string); void createArray (string*, string*, int, int, string*, int&); void run …

Member Avatar for grumpier
0
115
Member Avatar for Jennifer84

This is off topic, but I'm curious... Why did you use msiL implementation with unmanaged code? Why not purely managed or purely unmanaged?

Member Avatar for mitrmkar
0
154
Member Avatar for zzmgd6

[QUOTE=zzmgd6;698420]Thank you for the reply, but wrong way, I believe you're showing pushing an array of character strings into a vector<string>. Regards.[/QUOTE] Not quite. It would be valid if your array consisted of const char* values because strings accept const char* (and also chars) as a constructor argument via the …

Member Avatar for zzmgd6
0
204
Member Avatar for letlet_pogs

How do you need your tokens to be parsed? An example... [code=java] public class TokenMaster{ public static void main(String... args){ String myReallyBIGString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n" + "ALPHABETICAL!\n" + "SOMETIMES I FEEL I'VE GOT TO 'AH-AH' RUN AWAY, I'VE GOT TO... " + "'AH-AH' GET AWAY!!!\n" + "RING RING RING RING RING …

Member Avatar for Ezzaral
0
146
Member Avatar for dickersonka

[QUOTE=dickersonka;698124]I am working on a logger showing showing types and values for classes and sql statements (ie parameters in sql statements) From the example above I will need to show output as something like Long: null and BIGINT: null What is a possible recommendation to be able to do this? …

Member Avatar for dickersonka
0
1K
Member Avatar for DemonGal711

Is there a reason you are using '/n' instead of '\n' ? Also, is there a defined expression for a string being equivalent to a char? If not then you could try line != "\n" instead, though I don't mess with file I/O in C++ too much so I can't …

Member Avatar for DemonGal711
0
105
Member Avatar for renoss

Why exactly does class B have to extend A? From an immediate glance I can see a potential cycle instantiation issue. Think about it-- 1) Class A, after static initialization, will instantiate a class B object-- 2) Class B extends A, so when a B object is constructed, the super …

Member Avatar for Ezzaral
0
122
Member Avatar for c++ prog

I do not recall the arrow keys having a virtual key code associated with them from standard C++. I think the only way to do it is through the OS interpretation of the virtual key code of the keyboard, though I could be wrong... [url]http://delphi.about.com/od/objectpascalide/l/blvkc.htm[/url]

Member Avatar for Duoas
0
264
Member Avatar for PRob99

Remive the semi-colon by your while-statement and you should be in business =)

Member Avatar for kingvjack
0
165
Member Avatar for shamila08

Your reverse function looks suspicious. You are overwriting the initial element before you store it to replace the last element, so the data is unrecoverable and you will end up with a mirrored half-way reversed array instead of the entire original array reversed. The tmp implementation isn't helping because its …

Member Avatar for Nick Evan
0
160
Member Avatar for dodo_ind

Previous: strings can only hold a certain amount of data, so I'd assume so. Have you considered using the non-standard rope to meet your data needs? Or possibly a vector<char> implementation? Edit: Actually my previous post might need some more investigation, so I'm omitting it. My apologies.

Member Avatar for Alex Edwards
0
202
Member Avatar for W@n

You could create a class for the information that you read in (such as a Person class) and assign the attributes to data (i.e., a String for the line being read). Then make each Person object implement Comparable<Person> After generating the objects based on the data retrieved from the file, …

Member Avatar for BestJewSinceJC
0
698
Member Avatar for jagdishc

This looks like C and not C++... Use C++ implementations-- [code=c++] #include <iostream> using namespace std; int main(){ cout << " Testing 123... " << endl; cin.get(); return 0; } [/code]

Member Avatar for jagdishc
0
81
Member Avatar for daviddoria

[QUOTE=daviddoria;685535]I actually don't have control over glutMouseFunc [B](I mean I suppose I could edit the glut source, but that sounds like a bad idea)[/B] Why is it so much different to pass a member function than a normal function? Is there no way to do this without overloading glutMouseFunc? Thanks! …

Member Avatar for kux
0
670
Member Avatar for waldchr

[QUOTE=waldchr;691109]It always comes up with an error: The Directory "C:\config_file_directory" doesn't exist. Dev-C++ will now quit, please create the directory first. I tried reinstalling the program but that also didn't work.[/QUOTE] Did you try using C:/config_file_directory instead? It may be that the \c is being mistaken for a special escape …

Member Avatar for waldchr
0
173
Member Avatar for prateeknigamk

[URL="http://www.daniweb.com/forums/thread142503.html"]Because I don't like to repeat myself[/URL] =P

Member Avatar for fireheart1024
0
95
Member Avatar for llemes4011

160,000 elements in an array can be memory-expensive... so let's try to find a way to make things less expensive. First of all, what is the range of your points (what are they for, and what is the maximum number you're planning on using per coordinate)? If the point-value is …

Member Avatar for Alex Edwards
0
88
Member Avatar for eehyf

This is the C++ forum, so why would you use strcmp? You can use string objects. Include <string> and you can compare 2 string objects lexigraphically with the string.compare(string) method. I'm not near a c++ compiler atm, but the implementation will looks something like this- [code=c++] #include<iostream> #include <string> using …

Member Avatar for grumpier
0
154
Member Avatar for AutoC

It seems to me that you have a set of values returned to you from a traversal order and you would like to reconstruct the tree? If you refer to this [URL="http://en.wikipedia.org/wiki/Tree_traversal"]Tree-pedia[/URL] link, you will see different methods of traversing trees and how they are mapped out with values =) …

Member Avatar for Alex Edwards
0
135
Member Avatar for balakrishnan.kb
Re: c++

To make an example of the difference via implementation-- [code=c++] #include <iostream> #include <memory> using std::cout; using std::cin; using std::ostream; using std::auto_ptr; template<bool>class B; template<bool>class C; template<bool>class D; class A{ public: ostream& run(ostream& out = cout){ return out << "Class A\n"; } }; template<> // when true, run is virtual, …

Member Avatar for Alex Edwards
0
108
Member Avatar for srs_grp

wxWidgets, qt, OpenGL, Ultimate C++, Win32 API, MFC (AFX), and I think .NET cover the general potential GUI implementations, though I'm sure there are more.

Member Avatar for Alex Edwards
0
76
Member Avatar for Panarchy

What specific implementations do you need? Learning Java is quite the trial. To get a decent dosage of Java, I strongly STRONGLY recommend "Java, How to Program 7e" by Deitel & Deitel. But this isn't good enough. Simply learning the language and some implementations might not be enough. What if …

Member Avatar for masijade
0
239
Member Avatar for Jennifer84

Correct me if I'm wrong, but you are using the .NET Frameworks with C++, are you not? If you are, have you tried looking up information on individual Components in the .NET Frameworks the way you want them to? I was capable of compiling and running [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.splitcontainer.aspx"]this[/URL] example using Visual …

Member Avatar for Jennifer84
0
123
Member Avatar for peter_budo

I don't think it's the run method that isn't executing, Peter. I think the problem is that you are not submitting a Runnable target as the argument for the Thread to execute. I actually don't understand why the Thread class is not abstract if it allows one to simply give …

Member Avatar for Ezzaral
0
136
Member Avatar for francisprite

[QUOTE=EDDYGATE;691760]I also just move from c to java and i found this book "java how to program sixth edition" very useful. you can e-mail me on <snipped email> so that i can send it as an attachment[/QUOTE] The Deitel and Deitel books are always awesome. I also, second the recommendation …

Member Avatar for kalyan_au_cse
0
125
Member Avatar for phintastic

The problem wasn't the import. It looked like the OP already had the import listed. The problem is that the Scanner class does not provide a "default" constructor for Scanner objects. For a list of proper Constructors for Scanner objects, refer to this [URL="http://java.sun.com/javase/6/docs/api/java/util/Scanner.html"]link[/URL]. The most common use for a …

Member Avatar for Alex Edwards
0
1K
Member Avatar for JackDurden

[QUOTE=VernonDozier;692724][B]push_back does NOT separate the line into words. That's a separate problem. There's more than one way of doing that and I don't know whether this is for a school assignment or not, or what you've been exposed to. As far as splitting the string into words, you may use …

Member Avatar for Alex Edwards
0
187
Member Avatar for coveredinflies

Ok, I'm slightly confused about what just happened in this topic... A fair amount of individuals stated that returning a reference of the actual object that represents the class is more preferable than returning a copy that has the reflected changes made on the object. Sure, for performance reasons, it …

Member Avatar for vijayan121
0
192
Member Avatar for Emerald214
Member Avatar for PuQimX

[QUOTE=williamhemsworth;691666]>I like what your saying.... to be a good programmer we must love the program..!! To be a good programmer, you need to know how to make a program.[/QUOTE] Seconded.

Member Avatar for obj7777
0
112
Member Avatar for coveredinflies

I joined Daniweb about 3 months ago, and during that time I started self-learning C++. Amazingly, a lot of knowledge of Java migrated to my understanding of C++ and vice-versa! By understanding pointers and references as well as learning the Object Model of C++, I started to better understand Java! …

Member Avatar for William Hemsworth
0
160
Member Avatar for VernonDozier

After running some tests I realized that somehow your transform is jumping between 1-22 on the (result?) matrice-- [code=java] import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.io.*; import javax.swing.*; import java.util.*; import java.lang.*; public class ColorForms extends JFrame { LeftPanel leftPanel; TopPanel topPanel; CanvasPanel canvasPanel; JSplitPane wholePanel, bottomPanel; …

Member Avatar for VernonDozier
0
828
Member Avatar for Jennifer84

Vectors have an overloaded Constructor that allows two arguments... I do believe, in that scenario, the first argument is the initial size and the second is the default value for all values in the vector. [code=c++] std::vector<std::vector<int> > vec2(100, std::vector<int>(50, -1)); [/code] [URL="http://www.cplusplus.com/reference/stl/vector/vector.html"]Source[/URL]

Member Avatar for twomers
0
738
Member Avatar for debargha

Are Model 2 projects allowed? Aka, MVC, JSP/JavaScript front-end, Servlet controller, Database back-end...?

Member Avatar for Alex Edwards
0
92
Member Avatar for AllenB

Maybe this will do the trick? [code=java] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Ball extends JApplet implements MouseListener { private MyThread blueBall[] = new MyThread[MAX_BALL_COUNT]; private boolean bouncing; // xUp, yUp //private int x, y, xDx, yDy; int ballcount = 0; final private static int MAX_BALL_COUNT = 20; …

Member Avatar for AllenB
0
2K

The End.