Posts
 
Reputation
Joined
Last Seen
Ranked #765
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.7K People Reached
Favorite Tags

79 Posted Topics

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
348
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
198
Member Avatar for gerard4143
Member Avatar for gerard4143
0
366
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
140
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
199
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
96
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
372
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
397
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
213
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
145
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
72
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
247
Member Avatar for namasee
Member Avatar for mitrmkar
0
96
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
678
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
139
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
118
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
92
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
178
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
161
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
81
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
124
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
263
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
445
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
114
Member Avatar for rpdm
Member Avatar for alwaysLearning0
-1
112
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
235
Member Avatar for Jsplinter

I've never seen this issue before, but I did google something interesting about __w64 Source: [url]http://msdn.microsoft.com/en-us/library/s04b5w00%28VS.80%29.aspx[/url] Some more information on your Data type (and maybe compiler settings) might shed some light on this issue...

Member Avatar for Intrade
0
228
Member Avatar for grahf23

I think the problem may be the way you're abstracting the code. Why are vending machines named after specific products? Why not have a Vending machine that CONTAINS products (and a certain amount of them), and when a sale is made the product amount for that particular product is deducted …

Member Avatar for Intrade
0
223
Member Avatar for sg79

Hmmm This is A WAY of going about it. You don't have to follow this word-for-word. This will give you an idea of what you can do. -- You can make a class called BigInt that accepts a const char* or string as a number (or int), converts whatever case …

Member Avatar for Intrade
0
276
Member Avatar for stephanie7

The algorithm is explained in detail here: [url]http://en.wikipedia.org/wiki/Magic_square[/url]

Member Avatar for stephanie7
0
87
Member Avatar for Christ1m

[CODE]//Phone_Directory.cpp #include "StdAfx.h" #include "Phone_Directory.h" #include "Directory_Entry.h" using namespace std; void Phone_Directory :: load_data(const string& source_name) { this->source_name = source_name; // Maybe you need to import a header file for ifstream? ifstream in(source_name.c_str());[/CODE] [url]http://www.cplusplus.com/reference/iostream/ifstream/ifstream/[/url]

Member Avatar for Intrade
0
214
Member Avatar for itpipx

3 problems Declaration of a copy constructor should be of a const reference variable parameter and not just a reference variable parameter-- [CODE] Exforsys(const Exforsys& e) [/CODE] --you might get away with it during compile/run but your professor may dock you points. second, not sure if void main() is going …

Member Avatar for itpipx
-1
134
Member Avatar for Intrade

Hello everyone. Sorry in advance if my question seems noobish. I'd like to know if it's possible to change my router such that it uses another, dynamically assigned IP address to be accessed as opposed to my current. Let's assume my WAN IP address is A.B.C.D and I turn my …

Member Avatar for CimmerianX
0
193
Member Avatar for invisi

int* resizeArray is a declaration that states "hey, I want space for a pointer to an int" int resizeArray is a declaration that states "hey, I want space for an int" int* resizeArray is a pointer to an int that can be [I]treated[/I] as an array, whereas int resizeArray can …

Member Avatar for Greywolf333
0
115
Member Avatar for Intrade

I followed this guide for VC++ 2010, [url]http://msdn.microsoft.com/en-us/library/ms235636.aspx[/url] and apparently I either have a missing module/component or I did something wrong. I followed everything smoothly up until step 6-- "6. To build the project into a DLL, from the Project menu, select MathFuncsDllProperties…. On the left pane, under Configuration Properties, …

Member Avatar for Intrade
0
272
Member Avatar for Christ1m
Member Avatar for Intrade
0
264
Member Avatar for William Hemsworth

You did this in half an hour!? Wow that's crazy! O_O You are indeed a fast programmer XD However I did need to convert the C-style cast into a static_cast from the random generator (for Dev-Cpp, Mingw compiler)-- [code=c++] //.. blah... srand( static_cast<unsigned int>(time(NULL)) ); //.. blah... [/code]

Member Avatar for William Hemsworth
2
7K
Member Avatar for wh33lz

It seems like you may want to consider collecting the characters themselves into a vector, then extract the contents of the vector into a string, then pushback the string into your vector of strings. It would cause additional overhead but you wouldn't have to worry about the string classes limitation …

Member Avatar for evilctofwoc
0
6K
Member Avatar for Areej N
Member Avatar for mtusk

Not sure if I udnerstand the question, but I think you mean something along the lines of setting a value of one of the Z variables in the array? [CODE] struct Z{ int a; int b; Z() : a(0), b(0) {} void setA(int x){ a = x; }; void setB(int …

Member Avatar for mtusk
0
119
Member Avatar for Doughnuts
Member Avatar for ellimist14

Well you're comparing the gpa of each individual node to a seperate "min"/"max" on the stack. Of course your output wont be correct. Keep in mind that you're using recursion, and you want to pass the new minimum value to each method as well to determine the true minimum value.

Member Avatar for Intrade
0
138
Member Avatar for Perham

[QUOTE]now, I went into windows.h and related headers, and extracted those struct definitions, and put them directly into the code. then removed the include line of windows.h.[/QUOTE] Honestly, why did you do this? It's possible that some of the windows code uses defined values that may be modified outside of …

Member Avatar for Intrade
0
106
Member Avatar for kangekraam

I did some experimenting after running the console window on my computer (Windows Vista SP 2) and I produced ^B with ctrl + b keys pressed.

Member Avatar for kangekraam
0
98
Member Avatar for plobby

[CODE=cplusplus] struct PhoneTones { int rowTone, // Frequencies of the tones generated by a key press colTone; }; // Function prototype PhoneTones keyToTones ( char key ); //-------------------------------------------------------------------- int main() { char inputKey; // Input key PhoneTones keyFreqs; // Frequencies of the corresponding tones // Read in a series of …

Member Avatar for plobby
0
128
Member Avatar for new programer

To be honest, I would rewrite some of the code to use pointers as parameters versus an array parameter. It's been awhile since I've worked directly with C++ so I'm not entirely sure. I am a bit concerned about this chunk of code though-- [CODE=cplusplus] # include <iostream> # include …

Member Avatar for Intrade
0
94

The End.