Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~6K People Reached
Favorite Forums
Favorite Tags
c++ x 19
java x 8
Member Avatar for rugae

I'm not quite sure the difference between strcmp and == operator when comparing 2 different strings, I was told to do this but == works as well with less typing. [code=C++] if ((strcmp (a, b[i]) == 0)) { someMethod(); } else someOtherMethod(); _______________________________ if (a==b)) { someMethod(); } else someOtherMethod();[/code] …

Member Avatar for Nikolay_2
0
4K
Member Avatar for rugae

Learning about all functions in <iomanip> and was testing out setprecision() and found that something weird is going on...? I did try to do a search on setprecision() limitatations or similar keywords but can't seem to find the right site... can someone please tell me what's going on? [code] double …

Member Avatar for barevhayerable
0
515
Member Avatar for rugae

I can't figure how to get this going, for every object I create I want to add that to the existing array. I read about arraycopy but I don't know how to increase the existing size of the array and always end up with array out of index error... [code=java]A …

Member Avatar for eng.M4AH
0
159
Member Avatar for rugae

I need some advice on the way I'm should be doing something like this... My main GUI is composed of a JTable and query box for custom SQL user queries. I execute a SQL query, from the ResultSet, map the ResultSet an ArrayList<Object>, parse it to a tableModel class extends …

Member Avatar for rugae
0
179
Member Avatar for rugae

I've know that a pointer to some dynamic memory must be deleted to prevent memory leaks. Now if say a struct/array or some other data structure, each with its own dynamic memory parts. If that structure (class, file...etc) contains the data structure goes out of scope does that automatically free …

Member Avatar for Narue
0
122
Member Avatar for rugae

Is it safe to compare strings with == operator or is .compare recommended? One of my teachers said NOT to use the == operator and always use a function when available. The example given was somthing along the lines of "when cpu is under high usage the == operator behaviour …

Member Avatar for vijayan121
0
201
Member Avatar for rugae

I have like 5 classes, 3 of then need around 15 constants the other 2 classes need only 2 of the 15. I was thinking of having a header file to contain all the constants in header file and just include them in the header files of all 5 classes. …

Member Avatar for vijayan121
0
124
Member Avatar for rugae

[CODE=c++]string a = "hello"; char b[20];[/CODE] Other than a for loop to copy character by character over is there some sort of function to convert strings to non const chars arrays? I don't even know if it exists or not but some kind of non const cast for a.c_str() perhaps?

Member Avatar for rugae
0
67
Member Avatar for rugae

One function is pass by pointer which stores the reference, the other is just pass by a reference... are theses methods equvilent or does one method require more memory than the other? [code=c++]#include <iostream> using namespace std; void cubeByRef(int *num); void cubeByRef2(int &num); int main(){ int a = 2; cubeByRef(&a); …

Member Avatar for Ancient Dragon
0
121
Member Avatar for rugae

I was wondering if it's possible to change or add values to enum types? Such as changing the string "This is a msg" or add additional value to the type test. May I have some tips? [CODE] public enum Test { VALUE("This is a msg"); private String x; Test (String …

Member Avatar for dwks
0
122
Member Avatar for rugae

I would like to make so that when you have a int and prompting user to enter some number for calculations... if the number entered is larger than a 10digits, my program wouldn't just crash or if the user enters a string... I havn't be taught any error catching stuff …

Member Avatar for stultuske
0
143
Member Avatar for rugae

Ok, I new to this and haven't been taught exception handling yet but I would like my program to run without crashing when someone mashes the keyboard. I have declared an int x, and I don't want my program to crash when user inputs an char or more than 10 …

Member Avatar for John A
0
140