General C++ Programming - September 2012 (Page 8)

definition of a variable in class
 
I am trying to define a variable in a following class. Foam::tmp<Foam::volScalarField> Foam::viscosityModels::EllisLaw::calcNu() const { dimensionedScal...
[3 replies] Last: I am trying to define a variable in a following class. You didn't s... (by doug4)
Code::Blocks - No default include directory.
 
I've just installed code::blocks and have tried to create a simple console program as per below: #include <iostream> #include <cstdlib> using name...
[7 replies] Last: Thanks for coming back all.. I've got it working now. It seems I've b... (by dominover)
Need Help with Binary Searching!
 
2. Given an array storing integers ordered by value, modify the binary searchalgorithm to return the position of the integer with the greatest value less thanK(...
[1 reply] : This will cause you to infinite loop.. while(i<=j) { if(key>arr )... (by HiteshVaghani1)
A function to compare strings in a class
 
Hi everyone, I am having an issue doing part of a homework assignment. We have been building a program that makes a small phone directory, and the names of ...
[1 reply] : How do I use both the function and the sort together? How can I call ... (by buffbill)
by odinx
c++ bisection problem
 
#include <iostream> #include <cstdlib> #include <cmath> using std::cout; using std::endl; using std::cin; int main() { double h,v,w,z,y; cout << "Enter t...
[2 replies] Last: L58 needs to end with a ; Sorry no idea what you are trying to do (by buffbill)
prime number functions- help
 
My teacher has assigned us to write a function that can tell if a number is prime or not, we already wrote a program that allows a user to enter a number and th...
[7 replies] Last: teacher has assigned us to write a function that can tell if a number... (by buffbill)
C++ Core dump error
 
Hello, I am trying to find max and average from a 1D array. No problemo. HOWEVER I get a core dump error and all the numbers are all messed up when I run my ...
[3 replies] Last: A_SIZE should be set to 8. Does L 32 print out all the numbers from *t... (by buffbill)
Looping -___-"
 
Guys how can i create a looping of Prime number in C++, i really don't get the point --" please use a simple C++, cause i'm a newbie ^^
[2 replies] Last: how can i create a looping of Prime number in C++, What? please mar... (by buffbill)
Need help with C++ problem?
 
Hi, I am a beginner in coding altogether, and the if else statement is really confusing me.? My assignment is to Prompt the user to determine if they have ...
[2 replies] Last: here's another few things: 1)what is the value of priceAdult? 2)what d... (by buffbill)
C++ 2D Array Help
 
Hello. I'm trying to reverse the rows in a 2D array. I can not use switch. Here is what I have so far! #include <iostream> using namespace std; c...
[2 replies] Last: I GOT IT!!!!!!!! Thanks (by legnakcalb)
Need help with C++ problem? (don't know how to write the code)
 
Overview For this assignment, write a program that will calculate the amount that a customer spends on tickets at a movie theater. The program should: ...
[6 replies] Last: #include <iostream> #include <iomanip> using namespace std; int mai... (by Game4564)
Recursive Binary Search using array. HELP!
 
OK so I'm trying to write a program that performs recursive binary search. this program suppose to ask the user to enter a number to look for, it will then call...
[2 replies] Last: OK so this is what i got now, it works except when i enter a bigger nu... (by lugiamaster)
A problem about STL(string and vector)
 
Firstly I define a struct with a stl(string) member like here: typedef struct _UdpClient{ int fd; fd_set rset; string ip; unsigned short p...
[1 reply] : There's no way anyone could figure it out from ten lines of code and a... (by helios)
problem writing out to a file using a structure
 
Hello All, I am having a problem writing out an array of structures to a text file. I originally wrote this program with just an int array and it worked. i t...
[no replies]
by iky
need help programming please!!!
 
Hi. I need help programming a program i am try to write. For the program, i have to compute statistics for a sports team. I need to write the name, # of wins, l...
[6 replies] Last: ok so this is what i have done so far. didnt add much but this is it: ... (by iky)
by vw4x4
explain this statement
 
1) enumerated data types are treated internally as integers.please explain this statement 2)can we consider them as a method of creating a new data type,in tha...
[1 reply] : This is homework designed to test your attentiveness in class and your... (by Duthomhas)
by Yamraj
Converting Integers into Words problem.
 
Hello, I wrote this program, and it runs fine until you go into the thousands. Then things get messed up. Here is the code: //assign_1_12_numberestowords.cp...
[9 replies] Last: Here's the test case. I also made an addition of where the numbers can... (by Yamraj)
by iky
printing decimals??
 
hi. how i print an average with four decimal places?? what would i need to type in the program for that too happen and what am i supposed to declare? thanks a l...
[1 reply] : float w/ cout.fixed(int) (by Aramil of Elixia)
CC digit matching
 
Valid input: xxxx xxxx xxxx xxxx OR xxxx-xxxx-xxxx-xxxx (x being digit 0-9) Correct Output: Only 2 possibilities are Valid or Invalid My Output: ALWAYS Valid...
[2 replies] Last: Ok, I think I fixed my conditons, but when I input the credit card num... (by g0blu322)
OpenGL Textures
 
I'm having a hard time figuring out how to import custom textures / sprites into OpenGL through C++. I have looked around and most of the codes doesn't textu...
[4 replies] Last: Using Windows, so <Windows.h>, it is a Win32 project too. And checkin... (by Callum5042)
September 2012 Pages: 1... 678910... 32
  Archived months: [aug2012] [oct2012]

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