68 Topics

Member Avatar for Alex Edwards

Does anyone have an website they would recommend to me for learning Regex? I have tried using the Sun's tutorial on Regex as well as the Pattern and Matcher classes that use Regex but I am not quite understanding it. I'd like to use it to return the String values …

Member Avatar for sciwizeh
0
128
Member Avatar for Alex Edwards

I found an interesting question on the internet... An interviewer asked a programmer "How would you divide without using division or multiplication?" And the programmer came up with some weird bit shifting operation that did the division. Now, I'd like to make a program that does something similar, since-- int …

Member Avatar for Alex Edwards
1
383
Member Avatar for Alex Edwards

[code=c++] #include <cstdlib> #include <iostream> /** Test Class for learning template-metaprogramming */ using namespace std; template<int N> //General case for a number class ShowValues { public: static inline void show() { cout << "Start: " << N << endl; ShowValues< (N > 1) ? (N - 1): 1>::show(); cout << …

Member Avatar for vijayan121
0
129
Member Avatar for Alex Edwards

This isn't exactly a thread about a particular question, but a thread that may help people with memory dynamically allocated/deallocated during runtime. The below example goes over pointers in multiple dimensions-- [code=c++] #include <cstdlib> #include <iostream> /** This program can be used to determine whether pointers are deleted or not …

Member Avatar for vijayan121
0
102
Member Avatar for Alex Edwards

Is there a website that has some kind of GUI or application that allows users to enter statements like-- delete delete [] for... n elements... delete arr[n] --etc so that they can learn good memory management? I sifted around some free ebook sites and found one but the link to …

Member Avatar for mitrmkar
0
115
Member Avatar for Alex Edwards

I'm getting a really odd error in my program. The lvl value retains its initial value if it's left alone, but when the program runs after you've assigned it a value it get's a ridiculous number... then the previous number after another assignment... and the process continues. Here's the code. …

0
98
Member Avatar for Alex Edwards

I hear this argument a LOT and hear that templates/generics are far more superior in code production than virtually-driven classes. I still don't understand this. I've heard the virtual functions cause problems for performance and that the solution is always to use Templates/Generics. Do they mean that it is better …

Member Avatar for Radical Edward
0
1K
Member Avatar for Alex Edwards

I don't understand... I thought that it would be functional based on the logic, and I was fairly careful with my syntax but it's still not working. Sometimes values will compare to as being "equal" even though they're not. I'm using troolean compareTo method (an int, returns -1, 0 or …

Member Avatar for Alex Edwards
0
115
Member Avatar for Alex Edwards

I was working with my own "Vector"-like class and thought about something. If I use the [] operator and return a reference, is there any way to mark that indice when a value is assigned to it? For example.. if I want to make a trim function that removes the …

Member Avatar for Radical Edward
0
214
Member Avatar for Alex Edwards

Whenever I try to declare a "Regular Expression" while including symbols like "+", "-", "*", the match is done based on how those operators work. Now, when I try to use the regex API via combining those operators with backslash or \Q and \E I get the error message-- "...Illegal …

Member Avatar for Alex Edwards
0
121
Member Avatar for Alex Edwards

I don't understand what is happening to my program... I have a feeling that private members are marked private for a reason, because I'm having a serious error with accessing base-class data types via inheritance and declaring friends within classes... If you run the test program after attaching the header …

Member Avatar for Alex Edwards
0
163
Member Avatar for Alex Edwards

Right now I feel fairly unlearned with dynamically allocating memory... even after doing so several times and doing projects that require one to dynamically allocate memory for classes and primitive types. Basically, how does one research allocation for different scenarios such as... [code=c++] #include <cstdlib> #include <iostream> using namespace std; …

Member Avatar for Alex Edwards
0
75
Member Avatar for Alex Edwards

Okay so I have a program that tests for collisions using a complicated and 80% accurate method, but I want 100% accuracy. Like someone posted earlier about shapes colliding into each other, I realized that there will be cases where my method wont work. However, I've looked into a calculus …

Member Avatar for Alex Edwards
0
132
Member Avatar for Alex Edwards

Correct me if I'm wrong but... Each time I declare an object without assigning it a value, I am instantiating it (so long as the valid constructors is called upon doing so--) like... [code=c++] Triangle tri1 (3, 4); [/code] and this object exists on the stackk but only for the …

Member Avatar for Alex Edwards
0
218
Member Avatar for Alex Edwards

The error is listed in the title and then commented in main (last comment). The program runs but once it encounters the bool expression I overloaded, it seems as if the program pauses. I have a feeling it's a stack overload due to the way my function operates, but I …

Member Avatar for Alex Edwards
0
85
Member Avatar for Alex Edwards

Ever since I have heard that you can generate classes during runtime (from say, a URL I suppose) and can use java.lang.Reflect to fire methods based on String input, I was wondering how the process is done?

Member Avatar for Ezzaral
0
105
Member Avatar for Alex Edwards

I looked up the method class and thought that it might be useful, but unfortunately Method objects must be public to be invoked. I'm just curious of when I'd actually really need to use the Method class. Maybe to create an array that used a type of algorithm to fire …

Member Avatar for dkerberwra
0
86
Member Avatar for Alex Edwards

Hello, I'm having an issue with a line of code that really doesn't seem that it should be giving me an error. Before posting, I've googled this error and looked at related links with no help whatsoever. Most of the "solutions" were for correctly-placed brackets or different names (since some …

Member Avatar for Alex Edwards
0
2K

The End.