Beginners - May 2011 (Page 10)

error C2668
 
First of all, I'd like to mention that I was going to post a reply and revive an older thread with this exact subject matter, but it was closed. I'm working ou...
[7 replies] Last: That definitely helps. Thank you, Veltas! (by plaid311)
by Jimbot
Editing member variables of objects in a vector
 
Hello, I have some code which adds a bunch of objects to a vector. I then wish to retrieve a certain object from the vector and edit its member variable. ...
[15 replies] Last: Then he calculates who's in reach and choses one and tells him the da... (by ne555)
class/struct/union
 
Rational Rational::operator+(const Rational &)const { int num, int den; c.num = a.num * b.den + a.den * b.num; c.den = a.den * b.den; } Hi everyone I'm...
[6 replies] Last: never mind i got it : ) thank you very much for your help! (by ledzepdoors1)
by snakec
2d array programming problem
 
Hi i want to use a 2 dimensional array . i want to know that .Can i declare 2d array as? int *a ; can anyone tell me how to use this kind of deceleration ...
[2 replies] Last: For an array created like this: int *a ; for(int i = 0; i < 3; i++)... (by shacktar)
3x9 Sudoku Solver: Number Insertion Function Failure
 
The function I created to insert unused numbers into the puzzle fails. I know that the decrement operations in the function don’t occur; however, this may not...
[11 replies] Last: I asked about your knowledge of data structures because keeping accoun... (by kfmfe04)
Templated Nodes for LinkedList
 
How do i template the a node instantiated in a class list without templating the class list? ex: node<char> -> node<int> -> node<string>... -> NULL; 1...
[3 replies] Last: This has been discussed before, recently -> http://www.cplusplus.com/f... (by m4ster r0shi)
by CStu
Store Program
 
I'm making a program where it first displays the food items in a .txt file. The user enters the food item name and amount of the food item. The program then out...
[7 replies] Last: My teacher told me to put in cin.ignore() somewhere after getline but ... (by CStu)
How to use setw() and setfill()
 
Hello everybody !! i have a problem with setw() and setfill() in this function: void inscrire() {int Num; cin>>Num; string const nomfichier...
[4 replies] Last: okkkkkk thank's a lot :) that's working : void inscrire... (by abdouait)
by newCpp
Access static variable from another class in another file
 
How do I access a variable found in another class in a different file. This is my attempt but it does not compile. Might have some syntax error. Just need the ...
[1 reply] : #include <Test.h> int main() { Test::var = 1; return 0; } ... (by kbw)
How do I get the address of a dynamic pointer?
 
How do I assign a 2 level (**) pointer to just a dynamic pointer (new type *)? Is this possible? I've tried this. char ** g; g = new (nothrow) char ...
[5 replies] Last: I've noticed that using sizeof() on the **(p+n) yields that it's only... (by coder777)
by snakec
c++ 2d array problem
 
Hi Can anybody tell me how to use a 2d in a single loop ? means i have an array of int like int a ; now i want to put value in this using a single for lo...
[1 reply] : for(int i = 0; i < 25; i++) a[i%5][i/5] = i; If you do output, ... (by hamsterman)
by nand
yet another question about enums....
 
Hello, I want to make a c++ practice problem based on chess. My trouble with enum, reduced to the essence is this: #include <iostream> using namespace...
[5 replies] Last: Hello, Thank you all for your help! A const char array is the best s... (by nand)
Email parser
 
So I am writing this program and need some help!! I need to prompt the user to enter the file name they wish to input from and if nothing is entered to input a ...
[1 reply] : You can use the string functions like find() or find_first_of(). They ... (by coder777)
by Jsel
Help choosing compiler and debugger
 
Hi everyone, I decided I want to begin learning how to program with c++ by using the compiler and debugger from the command line. What compiler/debugger would y...
[no replies]
pointer trouble
 
Hey, I'm having pointer trouble... My last function prints weirdly. I believe it of course has to do with the first function. I don't know why though. #inclu...
[2 replies] Last: LOL i ment loops... haha. and thanks. That makes perfect sense. I wond... (by brokenbot)
strsep
 
I have someone else's code, and my implementation doesen't have strsep() (apperanty it isn't common). What is an equivalent of p = strsep(&p, " \t"); , where...
[3 replies] Last: /* strsep.h Provides the 4.4BSD strsep(3) function for those that... (by Duthomhas)
where did i go wrong here?
 
int rows,cols,i,j; double score ,sum=0.00,ave=0.00,max=0.00,min=0.00; char retry; cout<<"Enter rows: "; cin>>rows; cout<<endl; cout<<"Ent...
[4 replies] Last: thanks im getting it right noe, thanks for the help Pravesh koirala! (by asymptotes14)
build target: definition
 
what is a build target? any illustration would be helpful...
[1 reply] : Could you give the context of "build target"? Without context, my int... (by jeffbmartinez)
Restarting a Program
 
I am creating a program but am unsure how to restart it after it is completed? I can use a loop function or a do loop. I was thinking of asking the question ...
[7 replies] Last: Thank you for being an ignominious jerk and reiterating what the two p... (by ascii)
Very quick/simple question
 
I apologize for such a mundane question, but it has been while since I've coded. What does the following code do: const BYTE* buff, /* Data to be sent */ ...
[4 replies] Last: I also recommend you don't write confusing code like that. This cod... (by Disch)
May 2011 Pages: 1... 89101112... 48
  Archived months: [apr2011] [jun2011]

This is an archived page. To post a new message, go to the current page.