Beginners - October 2011

Monty Hall Problem
 
Does anyone have any experience with this program. I have to simulate the Monty Hall Program with c++ and am having quite a problem grasping it. Any help would ...
[1 reply] : http://upload.wikimedia.org/wikipedia/commons/d/de/Monty_tree_door1.sv... (by thechad90000)
need help fixing my program, structs and arrays
 
hi, i am suppose to write a program that calculates measurements of shapes inputed from a txt file. i did that and wrote arrays for each measurement in a str...
[no replies]
Is there a way to change text and BG color multi platform
 
I've skimmed the archives and searched the net but this question seems not to have been asked. Ones addressed in the forums appear to be OS specific. I only ...
[2 replies] Last: I did not know that, thank you hamsterman. (by cheawick)
link list
 
AOA.........please someone help me in this assignment...! thanx When the program starts, it should display the following menu: 1- Enter student informat...
[5 replies] Last: i'll contribute by sayin the next part of the program should be like t... (by markyrocks)
by ivanho
Sieve of erathostenes
 
How can I write program who count prime nubers beetwen [a,b] with sieve of erathostenes but with using less memory (I use char fields)??
[5 replies] Last: Your program is very hard to read (plus is in C, which I don't like ve... (by webJose)
copying strings
 
I am using the following code to copy strings from one array to another. Upto 7 characters it copies fine but when the source string increases from 7 it starts ...
[11 replies] Last: yes variable n has no point and as far as the function goes it could b... (by markyrocks)
by ivlatt
Banking application
 
Hi all, I'm fairly new to programming even though I have some experience with Java, VB and now C++. I'm currently studying software engineering at Uni and hav...
[2 replies] Last: Just got it working, it was using pointers as I assumed. Sorry for be... (by ivlatt)
What is <<?
 
An inline function is defined as this: inline int pow2(int L) { assert(L>=0); return (1<<L); } Can anybody let me know that what 1<<L means? What is...
[2 replies] Last: ivanho, Thank you for reminding on shift operators! Thx! (by subjugater)
Lab problem
 
first of all, sorry for my bad english. my professor gave us a problem. I've got to use 'struct' in solving the problem. I need to make a program that calcul...
[1 reply] : The condition in the last line of your code if (a>b+1,a<b-1) is not ... (by closed account D80DSL3A)
Memory Manager
 
Hi Ive been tasked with writing a simple memory manager and Im looking for some general advice and pointers. Im required to keep track of dynamic memory a...
[5 replies] Last: Read up on memory allocation techniques. Some search phrases: "worst f... (by helios)
Finding how many words are in a line
 
I'm just looking for a few tips here on how to keep my homework assignment from killing me. Not asking for answers here just someway to go in the right directio...
[7 replies] Last: Turns out that I had two things wrong. I didn't initialize totalWordCo... (by thechad90000)
c++ memcpy
 
Posted this on another forum. I thought I will try to post on this site and see if I get any responses. Can you please explain if there is any overlap or any d...
[1 reply] : There will be no overlap I would prob call them in the reverse orde... (by andywestken)
multiple .cpp files - help needed
 
Hello... try as i might, i can't get multiple source files and a header to work. my brain is now aching! here is my code ;) main.cpp #include <iostream> ...
[1 reply] : Header files usually contain variable, class, struct, etc declarations... (by strongdrink)
Example for an algorithm
 
Hi everybody, i have an algorithm which need as an input lattice basis b_1,...,b_2 ]in Z. The programm starts with #include<iostream> #include<string> #...
[1 reply] : I'm not sure what you mean. You defined a 3D array aka matrix with 3 ... (by closed account DGvMDjzh)
question about NULL
 
while(x){ int registered; cout<<"Enter total number of registrants: "<<endl; cin>>registered; if(registered<0&&registered <=4){ cout<<"for "<<registe...
[2 replies] Last: std::cin is not going to help as it only reacts when you have data in ... (by closed account DGvMDjzh)
what causes an Unhandled exception error?
 
hi What causes the error below? I've created a dynamic array and deleted the objects after use, so why would this message occur? Unhandled exception at ...
[2 replies] Last: Problem solved: turns out its was a simple case of re-declaring a clas... (by Blessman11)
Pointer question
 
I was wondering, what would happen if i did something along the lines of float x = 4.0; // then let's input the pointer to x into a method: Method1(&x...
[3 replies] Last: I think that that is undefined behaviour. You should delete only thi... (by ne555)
string literals
 
I'm a bit baffled by the output from the following code: #include <iostream> using namespace std; int main() { int myints = { 1,2,3,4,5,6,7 }; ...
[4 replies] Last: Many thanks for your help, hamsterman. I understand this now. (by kamisama)
Please break it down for me?
 
So i was told to place this in my program to stop the command window from closing std::cout << " Press ENTER to continue..."; std::cin.ignore( std::nume...
[6 replies] Last: Doesn't endl purge the buffer? Nope. (by shacktar)
Iterator question
 
I noticed that whenever I call this function for(iter=my_list.begin();iter!=my_list.end(); iter++) { //alot of code here if(isTrue) addsomething(iter); } voi...
[1 reply] : If you used list instead of vector it should be fine. Also, you could ... (by hamsterman)
October 2011 Pages: 123... 59
  Archived months: [sep2011] [nov2011]

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