Beginners - September 2011 (Page 5)

MinGW crashes when running this program
 
Back. Noob as always. Had to take a long break due to school. Anyway, I wrote a simple program for spitting out prime numbers up to a number n (its value is har...
[2 replies] Last: How would I allocate it on the heap? Would I write something like this... (by Metallon)
by BHill
/b
 
I am trying to understand this code. //--------------------------------------------------------------------------- #include <clx.h> #include <iostream.h...
[14 replies] Last: Thanks Gaminic, I obviously had a huge DUH moment. I appreciate your ... (by BHill)
Else without a previous if
 
I'm just starting out at C++ and I keep getting the error: 'else' without a previous 'if' even though I'm sure it should work. Here's my code: #include <iostr...
[16 replies] Last: @Gaminic, this code compiled fine, but yea, like u said it ignores the... (by olzi)
searching and sorting
 
ok all, another programming problem that the instructor didnt go over well enough. 3 more posts to follow, 1 with the actual problem, what im trying to do, and ...
[5 replies] Last: put your code in the tags, makes it a hell of alot easier to read.... (by olzi)
Setting up OpenGL and GLUT Visual Studio 2010?
 
I am desperately trying to learn computer graphics.. But it's a bit difficult, seeing how I can't get OpenGL set up correctly >.<. I've followed a bunch of guid...
[4 replies] Last: First thing to do would be to place all the files in their correct dir... (by olzi)
by jabele
I cannot understand why it's truncating decimal
 
Greetings, this is my first post here, and I'm very new to C++ (and programming in general). I'm coding a program to calculate a CD investment and display the ...
[3 replies] Last: Yes, it helped very much! I used setiosflags(ios::fixed) << setprecis... (by jabele)
by abao66
Re: some talk about capacitors
 
Dear Sir or Ma'am, Shanghai Green Tech Co., Ltd. is a high-tech capacitor manufacturer in China with more than 30 years’ experiences: super capacitors...
[3 replies] Last: The company has earned a high reputation in domestic market and abroa... (by coder777)
I'm stumped, put me in the right direction?
 
I'm working on an exercise from a book(C++ without fear) as follows: Write a program that uses the Fraction class by setting a series of values by calling th...
[2 replies] Last: I see how I could fix it now, thanks. (by Zexanima)
by tonnot
A copy constructor for a class created as pointer is as simple as this ?
 
struct My_classA { vector<another_class> V1; vector<another_class> V2; MY_classA(const My_classA *ref) { this->V1 = ref->V1; this->V2 = ref->V2...
[7 replies] Last: ok, thank you very much (by tonnot)
by basel
removing a line from a binary file
 
Hallo I am programming with c language in Linux. anyway i have to define a function that takes a binary file or a pointer of it and change the file by that, t...
[4 replies] Last: thanks man i will try it (by basel)
Yahtzee Program help
 
I am brand new to c++, I have been taking a c++ class for about a month, and our current assignment is to program Yahtzee. My current problem is that I am havin...
[6 replies] Last: That fixed it, thank you very much. (by MeltyGoblin)
Convert LPBYTE to some kind of string
 
Below is part of my program code . WHat i want do : For now i check if some byte (i use for shift) from ptr contains specific ascii character. If yes i do s...
[no replies]
by ShaunL
Beginner Program (1,2)
 
Well, I've made a little progress from last week when I worked my first program using "getline" and "strings", but I'm still not good at using mathematics in pr...
[22 replies] Last: At no point do you set the values of waterbaseFee, wusageFee, sewageba... (by TheMeerkat)
Problems of boost and multithread
 
below are my codes class equalOut { public : typedef bool result_type; template<typename T, typename U> result_type const operator()(T ...
[3 replies] Last: According to your explanation, the boost::condition_variable do not g... (by coder777)
Why doesn't this if Statment work?
 
if ( total_weight <= GP_1_tons * tons_in_lbs){ Train_type = "GP-1";} else if ( total_weight > GP_1_tons * tons_in_lbs)&&(total_weight <= GP_2_tons * to...
[2 replies] Last: Yup, I just figured it lol Thanks (by Ssturges)
Number limits and range.
 
Hi, I'm having trouble understanding numeric limits when trying to make a range. It's essentially a program where you input 3 test scores, they have to be [0-1...
[6 replies] Last: int testScore1, testScore2, testScore3, /*a lot of typing*/, testScor... (by ne555)
by raezur
Bisection Method help
 
I am attempting to use the following code to solve per the Bisection Method for the roots of the following function: x^3-0.165*x^2+0.0003993 using episilon 1...
[1 reply] : In the while loop check, you are checking to see if the value of f(x) ... (by histrungalot)
by suede
replacing a char with another char in a string
 
how would i go about replacing a character with another character. an example would be replace all 'a' with 'b'. imput: abc output: bbc i need to detect all ...
[2 replies] Last: Don't worry i finally figured it out. replace( str.begin(), str.end()... (by suede)
by kayak
Help with code
 
Hey all, could someone help me understand what I am doing wrong here? When I try to build this code I get a response: "fatal error LNK1169: one or more multiply...
[1 reply] : Found a few mistakes. You can't initialize variables in a class, unles... (by whitenite1)
very simple encoder
 
ok so im trying to create a simple encoder that will simply set letters equal to numbers. i figure that i will have to make a char variable for every letter but...
[18 replies] Last: No need to apologize :) Try changing the condition in your for loop to... (by ascii)
September 2011 Pages: 1... 34567... 48
  Archived months: [aug2011] [oct2011]

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