Posts
 
Reputation
Joined
Last Seen
Ranked #761
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
91% Quality Score
Upvotes Received
13
Posts with Upvotes
9
Upvoting Members
9
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
4 Commented Posts
~53.3K People Reached
Favorite Tags
Member Avatar for sciwizeh

This may be a sloppy method of doing so, but you can send a reference to the JTextPane that you are using and manipulate the Caret after you are done sending characters to the Document. [code=Java] import javax.swing.*; /** * Main frame for the program. * @author Bill * */ …

Member Avatar for reguieg
0
347
Member Avatar for baconswife

[QUOTE=baconswife;1357002]I am writing a program that outputs whether or not a number is prime. Can anyone help me find where my syntax error is? Also, i get that i = 3; i <= num; i++ would be true for it being a prime number from the other forums I have …

Member Avatar for Mahfuz_1
0
194
Member Avatar for gerard4143
Member Avatar for gerard4143
0
357
Member Avatar for badllama

That's why default-types exist. Consider the Map interface, it is declared as follows-- [code=c++] template < class Key, class T, class Compare = less<Key>, class Allocator = allocator<pair<const Key,T> > > class map; [/code] Notice how class Compare = less<Key> and class Allocator = allocator<pair<const Key, T>> That means, if …

Member Avatar for badllama
0
139
Member Avatar for Intrade

My name... I'd rather not say. Intrade is fine. I would prefer to be referred as this name than my others anyways. I'm a very shy individual. I have a great need to become not just a good programmer, but a good Computer Scientist. I apologize for my past deeds …

Member Avatar for WASDted
0
197
Member Avatar for frogboy77

I am not that great with pseudocode, but this is a possible process. Basically you can use a map with string keys and int values to keep track of each sequence and if the same sequence is run into on the map, increment the value by 1-- [CODE=text] // Input: …

Member Avatar for frogboy77
0
95
Member Avatar for merse

*sigh* I didn't want to bother posting this because I'll probably get flamed, but maybe you can make use of it-- [code=c++] /** * Numerics.h */ #ifndef NUMERICS #define NUMERICS #include <sstream> #include <string> #include <iomanip> using namespace std; /** * Convenience class for enabling easy * conversions between strings …

Member Avatar for merse
0
370
Member Avatar for anthonys1mom

You forgot to prefix the functions with your classname... right now the compiler sees getWidth() and getLength() as functions declared/defined outside of your class that are independant of your class, so the variables W and L are searched for in global scope and not found-- [code=c++] //... // prefix getWidth …

Member Avatar for Lerner
0
17K
Member Avatar for emko

You need to add/initialize sum-- [code=c++] int sum = 0; [/code] -- and then change your code to accommodate one of your requirements -- [code=c++] #include <iostream> #include <iomanip> using namespace std; int main() { double firstNum, secondNum; // Operands char oper; // Operator int result; // Resulting value int …

Member Avatar for emko
0
393
Member Avatar for gizmo7008

You're trying to compare a string with a char-- [code=c++] //... char humanChoice(){ //... } //... // declare variables string human; //... human = humanChoice(); // assignment, not construction - http://www.cplusplus.com/reference/string/string/operator=/ if (human == 'Q' || human == 'q') break; // doesnt work - string == char isn't defined [/code] …

Member Avatar for gizmo7008
0
212
Member Avatar for lynneh3979

What exactly do you mean by updating? As in appending some information, incrementing the value of the char or how many times it is accessed? What exactly do you mean? And please use code-tags for your code- [CODE=c++] //...code [/CODE]

Member Avatar for VernonDozier
0
143
Member Avatar for jmcorpse

Ancient Dragon, you always amaze me with your code. How do I hash this out on paper so I'm not stuck wondering how to format my output? How should I conceptualize the left/right/internal modifiers being used with setw? [url]http://www.cplusplus.com/reference/iostream/manipulators/left/[/url] From the code given, is it safe to assume that fill …

Member Avatar for Ancient Dragon
0
70
Member Avatar for Intrade

Hello guys! I'm trying to learn the Boost regex library for a more-convenient means of error-checking and the asio library to allow a fairly portable-means of manipulating data over TCP/IP. My goal is to retrieve the file information from a website (basically http layer). My first problem is determining the …

Member Avatar for Taywin
0
244
Member Avatar for namasee
Member Avatar for mitrmkar
0
93
Member Avatar for Lord_Migit

I'm really curious about this, but where do you initialize the size of m_vParentPop2 (your DNA vector)? Just glancing at the code, I can only see that as the problem. I don't see anywhere where you've pushed DNA pointers into the vector before accessing its [] operator. I'm using TextPad …

Member Avatar for Fbody
0
671
Member Avatar for gotjeff5

You can completely omit the need to place your chars into ints for display by simply adding 48 to all of your chars in your 2D char array-- [code=c++] int X; int O; char board[num_rows][num_colm] = {{1,2,3},{4,5,6},{7,8,9}}; cout << "TIC-TAC-Toe" << endl; for(int i=0; i < num_rows; i++) { for(int …

Member Avatar for Intrade
0
136
Member Avatar for Mona..

[QUOTE=Mona..;1366850]hello.. What do we mean by binary search and how we can do it using C++ thanks..[/QUOTE] 1) [url]http://en.wikipedia.org/wiki/Binary_search_algorithm[/url] 2) [url]http://www.fredosaurus.com/notes-cpp/algorithms/searching/binarysearch.html[/url] I found these sources off of google. I really don't mean to sound mean, but before asking a question on a forum try exhausting other easy means of answering …

Member Avatar for Mona..
0
116
Member Avatar for vbx_wx

How do you want people to access your 4D vector points? At first glance I'd think something like this would work for you-- [CODE] float operator [] (int index) { index = (index >= 0) ? ( (index <= 3) ? index : 3 ) : 0; switch(index){ case 0: …

Member Avatar for mrnutty
0
90
Member Avatar for muze

Is there a specific reason you're using iostream.h in the brackets? You typically omit the .h but you also forgot to declare the namespace you're working in. Lastly, the function that takes "Test" I believe takes a slightly bigger datatype than const char* try prefixing it with L-- [code=c++] //... …

Member Avatar for thelamb
0
175
Member Avatar for Intrade

I'm fairly new to Boost. I would like to use the Regex library. I wanted to follow this guide but it seems that it supports other versions of VC++. [url]http://www.boost.org/doc/libs/1_44_0/libs/regex/doc/html/boost_regex/install.html[/url] EDIT: I tried finding a link to VC++ 6.0 and I can't find it >_<, apparently Microsoft is no longer …

Member Avatar for thelamb
0
110
Member Avatar for cableguy31

Okay, how about this. Make a function that accepts an IP Address, and the Subnet (Subnet Address and Mask) and have it return a bool. It returns true if the IP Address exists in the subnet, or false if it doesn't. [code=c++] bool ValidIP(const string& ipAddress, const string& subnetAddress, const …

Member Avatar for cableguy31
0
1K
Member Avatar for rayden150

How about writing some ideas on paper that you would like to personally code and then learn what you need to get the job done? Although this might seem daunting, it really pays off when you finish the project and you'll learn how to arrange your thoughts into Java code …

Member Avatar for ceyesuma
0
159
Member Avatar for ButterFly21

If | Original Servings / Desired Servings | = rate then rate = 1 / | Desired Servings / Original Servings |, but you don't account for this in your code. [CODE] //modify -1 below to be your new calculated value. return (rate - 0.1 * (1 - (1/rate))); [/CODE]

Member Avatar for ButterFly21
0
80
Member Avatar for miturian

Maybe something like this will work? [code=c++] class a; class b; class a { b* bpointer; }; class b { a* apointer }; [/code]

Member Avatar for Fbody
0
120
Member Avatar for Intrade

What I want to know is if I can call a function defined in a C++ class in Visual Basic through a .dll generated from VC++2010? Is this possible, or do I need to define the .dll with C++ raw functions outside of a class? For example, my class looks …

Member Avatar for Ancient Dragon
0
260
Member Avatar for Karasuma

In what way do you want it to bounce? Up-and-down or around the screen, or some other implementation? If it's just around the screen, you can give the object velocity (some dx and some dy) where dx is the rate at which it travels along the horizontal (and its horizontal …

Member Avatar for Karasuma
0
433
Member Avatar for BryantFury

You forgot to add return average to your function-- [code=c++] int calcAverage() { int sum=0; int average; int TESTVALS[5] = {2, 18, 1, 27, 16}; for(int i = 1; i < 5; i++) sum+= TESTVALS[i]; average= sum/5; return average; } [/code] -- so its possible that due to the lack …

Member Avatar for BryantFury
0
112
Member Avatar for rpdm
Member Avatar for alwaysLearning0
-1
111
Member Avatar for L.sha

For your function addingarray, try using actual pointers for parameters... [code=c++] void addingarray( int* a, int* b, int* c, int size){ //... } [/code] Also you are trying to push a void function into the outputstream which I don't think the compiler will like. Omit that. In the function addingarray, …

Member Avatar for Intrade
0
2K
Member Avatar for Morbane

You could try having a mapping of strings to numbers and upon entering a string as the key the map returns the value as an integer that the day represents.

Member Avatar for comeugive
0
232