- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 3
- Posts with Upvotes
- 2
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re:
I have four JTextFields where user is allowed to enter only numbers. Question is how do I do this? |
|
Re:
I've have a class function below (using fstream) for my game that I had working on Visual C++ 2008. When I tried to port my app to xcode, I found it compiled, but complained that the directory doesn’t exist. Believe me, the directory exists. I've checked and rechecked! Basically this … |
|
Re:
Has anyone ever seen a function call just get skipped? I am running in debug mode and it wont let me set a break point on the call and when i step to it it goes right over to the next line, no exceptions, no errors. Has anyone EVER seen … |
|
Re:
how would u diplsay the lowest or highest value of an array that the user entered so u ask the user to enter several number and it goes into an array then how would u display the highest/lowest value in that array to the sreen |
|
Re:
Hey, I decided I should probably read a book to learn about C++ considering there are so many and etc :P. My parents said they would buy it for me, but I just wanna make sure it is gunna actually be a book that will teach me alot and hopefully … |
|
Re:
[CODE]#include <iostream> #include <fstream.h> #include <string> #include <vector> void input(int, std::string); void output(); using std::vector; using std::ofstream; int main() { std::string filename = "file.txt"; int number; vector<int> tileList(); std::cin >> number; tileList().push_back(number); input(tileList(), filename); output(); return 0; } void input(vector<int> tileList, std::string filename) { //vector<int> tileList; this needs to be … |
|
Re:
I think I might be having trouble understanding variable initialization again, but thanks for the help. Also, if there is an operator for raising to powers, not scientific notation, I would appreciate hearing about it since I can't seem to find it in the index |
|
Re:
I am writing a payroll program with inheritance for a school assignment that has the following requirments: [B]Expand the Employee Payroll program to include hourly based and salary based employees. This phase uses an array of employee objects, inheritance for different classes of employees, and polymorphism for salary computation. The … |
|
Is there a difference, in terms of performance, between the two loops below? (myvec is type [icode]std::vector<int>[/icode].) [CODE]std::vector<int>::const_iterator pos; for (int i = 0; i < N; i++) { pos = myvec.begin(); // do something with pos }[/CODE] [CODE]for (int i = 0; i < N; i++) { std::vector<int>::const_iterator pos … |
|
I did some searching on this topic but couldn't find anything definitive. Are basic types automatically initialized to 0 in C++ when allocated via [icode]new[/icode]? For example, are all values of nums guaranteed to be 0 in the code below? [icode]int *nums = new int[10];[/icode] |
|
Re:
When using >> to extract data from an istream, are spaces skipped over? I.e., if I extracted every character from: "Hello, my name is not World.", would the 5 spaces not be read by >>? If so, is this behavior omitted from istream::get()? Thanks. |
|
Re:
[code=c] typedef struct _node{ char *name; char *desc; struct _node *next; }node; #define HASHSIZE 101 static node* hashtab[HASHSIZE]; char* m_strdup(char *o){ // the m_strdup function....... int l=strlen(o)+1; char *ns=(char*)malloc(l*sizeof(char)); strcpy(ns,o); if(ns==NULL) return NULL; else return ns; } int install(char* name,char* desc){ unsigned int hi; node* np; if((np=lookup(name))==NULL){ hi=hash(name); np=(node*)malloc(sizeof(node)); if(np==NULL) … |
|
The default copy constructor should work for the Polynomial class below because it does not contain any dynamic data types. However, when I create a new Polynomial via the copy constructor, it prints 0 for the value of each coefficient. How can I fix this? [CODE]#include <iostream> #include <vector> class … |
|
Re:
What do you think of this? [url]http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml[/url] |
|
Re:
How would I go about deleting all '' characters from a string? [B]I am using the command line to pass parameters with parenthesis, so anyone who uses my program will need to use '\(', '\), '\[', '\]', etc.[/B] |
|
Re:
a mouse is trapped in a labyrinth.. and he has to find the cheese! the input is W and H (height and width), and a graph like this one: [CODE] ##...# C###.. ...... .####. .....M [/CODE] i'm supposed to calculate the shortest amount of steps he needs to make to … |
|
I have a template function as follows: template <typename T> int my_func(T& arg) T is expected to be of type map<T1, T2>. T1 is expected to be of a basic type (int, long, etc.) and T2 is expected to be of type vector<T1>/list<T1>/etc. I want to iterate over the contents … |
|
If I declare a struct node, is the following legal in C++? [icode]node nodes_array[vector.size()];[/icode] I know this is not legal in C. However, my C++ compiler does not complain. Is this only in recent versions of C++, or has this always been legal in C++? |
|
I am writing a chess game to familiarize myself with the C++ language. I have a Board class which contains a 2D array of pointers to Piece objects. I want to implement Board::operator[] such that the following is possible: [CODE]Board b; Piece *p = b[0][0];[/CODE] I could just return a … |
|
Re:
Hi All, I have been working on this all night. I have to convert degrees to celcius and vice versa. I keep having 2 errors. "possible loss of precision". I am new to java, but also I think I am having serious mental issues at this point. Here is my … |
|
Re:
Hi im trying to write a program that sorts an array in alphabetical order and then into phone book order, Eg input: Jane Pascal 364756 Bob Smith 364758 Joe Bloggs 253647 The output should be: Bloggs, Joe 253647 Pascal, Jane 364756 Smith, Bob 364758 The plan is to have each … |