Beginners - May 2012 (Page 34)

by Sub
Getting compile error C2061, I'm not sure how to fix it
 
Hello! I'm trying to make Solitaire and I'm running into a compile problem. I have a class called Input and I have a class called Game. Whenever I try to pas...
[3 replies] Last: That's the problem. I deleted #include game.h from input.h and it now... (by Sub)
Is this a correct implementation of eratosthenes's sieve?
 
vector <int> arr (1,2); bool isprime; for (int c=3;c<50000;c++) // primes up to 5000 { for (int m=0;m<arr.size...
[2 replies] Last: Lol, I'll try again. (by rozick1)
Finding directories and/or files.
 
Hello. I would like to know what functions i can use to locate and search directories with. Please list them in the following format: function()/command : ...
[9 replies] Last: so.... anyone have step-by-step instructions or not? (by IWishIKnew)
Accelerated C++
 
This will be specific to anyone who has the book (preferably to hand), but in Chapter 4, section 4.5 (Revised grading program) is there a reason why there is no...
[3 replies] Last: The code in section 4.5 - calls some input/output functions - which a... (by guestgulkan)
program "stopped working" error!
 
I wrote this program to display the average of grades input into the program. We need to have a list with max size of 6, so anything after that 6th entry shoul...
[3 replies] Last: Add a dummy int somewhere and change line 127 to if (i < MAX_SCORES)... (by slicedpan)
template array initialization
 
Is there a way to initialize member dimensions for every A without a constructor? template<int A> struct Matrix { int dimensions { 0 }; };
[5 replies] Last: What compiler are you using? Because both MinGW 4.4.1 & Microsoft's Vi... (by closed account zb0S216C)
Multiple Source Codes
 
(In Microsoft Visual C++ 2010 Express Edition) I have a main source code and then about 10 separate different projects (all in the source code drop down) ...
[no replies]
Passing a pointer...question
 
I'm trying to pass a structure pointer to a class function. I want to pass the pointer in such a way that the changes made in the class function will be kept/"p...
[3 replies] Last: 2. I see people pass a pointer by pointer...how does it work? are the... (by dadabe)
Problem with pointers, need help!
 
#include <iostream> #include <conio> class sum { private: int* a; public: sum() { a = new int; *a = 0; ...
[3 replies] Last: The destructor is being called for the copy passed as a parameter to y... (by codeFoil)
remove 200 from int....
 
Hey. Gotta say my brain is 'melted' down right now, so I can't really figure simple stuff out... I have declared: points = 2000 How do I remove ...
[3 replies] Last: Yea thanks for the responses guys! Exactly what I needed. (by rawstyle)
C++ Without Fear Exercise 2.5.2
 
Hello, I been working on this exercise out of C++ without Fear Second Edition. It's a game called NIM where you are agaisnt the computer trying to be the first ...
[3 replies] Last: if ((total % 3) == 2){ total -= 2; cout << "I... (by twistedforever)
Problem with my Program.... Please Help
 
#include <iostream> using namespace std; void main() { int length, width; int perimeter, area; cout << "Length = "; c...
[2 replies] Last: Wow... i feel stupid right now.. i didnt even bother looking at the co... (by rsanchez1992)
Graphics Library
 
In C, there's a library called graphics.h , for graphics (obviously). Is there something like this for C++?
[1 reply] : There is no such graphics.h library in either C or C++. If you have... (by Disch)
How can I convert a vector of integers to a vector of characters?
 
I've tried: vector<int> integerarray; vector<char> chararray; for(count=0;count<integerarray.size();count++) chararray = integerarray ; But all i...
[3 replies] Last: You can initialize (or assign to) a std::vector<> using a pair of iter... (by JLBorges)
by equax
Calculating Volume within a text
 
I have a text file that contains a list of shapes that looks like this s1 tetrahedron 3.2 s2 cube 3.2 s3 octahedron 3.2 s4 dodecahedron 3.2 s5 icosah...
[5 replies] Last: Well, you are redefining it, aren't you? int main() { enum {NSHAP... (by JLBorges)
fstream counting new lines
 
i need help counting line numbers as i read through a file. the goal is to keep track of what words appear on what line number and store the word and line numbe...
[5 replies] Last: See if you can make sense of these modifications: if (doc) { // ... (by JLBorges)
case problem
 
Hi :) I'm having really weird problem. I have this script (or code if you will...) int main() { char reply; string login, pass; check_pass_file(); while (true...
[15 replies] Last: AWESOME! Thanks a lot! Working nice and flawless :))) (by justinko)
pointers
 
can someone explain to me this? int a=3, b=5, v=7; int *pa=&b, *pb=&c, *pc=&a; *pa = *pb + *pc; *pc = *pa * *pb; pb = pa; *pb = *pb + *pc; and what is t...
[2 replies] Last: I suggest, you should read a book about C or C++. This would be the no... (by dadabe)
by korbel
Error assigning value to char
 
So I can't figure out how to assign a value to a char. What I have below won't compile but if someone can suggest a better solution i would appreciate it. #...
[5 replies] Last: Awesome! thank you, (by korbel)
by Archa4
Automated testing
 
OK, so this is what I need to do: I have a C++ program. I have different text files, that the program uses as input files, 1 program run - 1 input file. I ha...
[10 replies] Last: comp tool1.out 1.out Why discuss so much, simply: try This are onl... (by dadabe)
May 2012 Pages: 1... 3233343536... 59
  Archived months: [apr2012] [jun2012]

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