Beginners - May 2012 (Page 49)

Clarification on OpenMP sections needed
 
Hi, I have a classic project - the producer/consumer problem. I have to do three versions of this: one which is serial, and the other two using openmp sectio...
[no replies]
How to tell the program to end in C++?
 
I have an if statement and if the statement is true, I want the program to end. Please keep in mind, I'm using XCode, so some stuff might not work. ex: int...
[3 replies] Last: return 0; (by shawngreene1)
using const in func declaration.
 
Hi If i do something like: #include <iostream> using namespace std; void test(const int a , double example); would that make example a ...
[5 replies] Last: Learn, I guess. (by Peter87)
by ihato
Why this sucks?
 
#include <iostream> using namespace std; int main() { int a = 0; int b = 1; int c = 1; cout << a/(b*c); } this prints 0. W...
[1 reply] : b * c = 1 a / 1 = 0 0 / 1 = 0 It's doing exactly what you told it to (by ResidentBiscuit)
by Yekim
File Input/Output
 
I have spent awhile messing with File I/O and I thought I was finally getting it, until I ran into the issue of trying to read an existing file. I was able to ...
[3 replies] Last: Thanks for the help guys, I feel real silly, but what ended up happeni... (by Yekim)
More assembly fun! Arrays and array manipulation
 
And I'm back with more of this excitement. As the title says, I'm on to arrays. I have two number sorting problems to get done, and I figure arrays are going to...
[1 reply] : Actually, I'm on to something. Got some help from a friend, and it mak... (by ResidentBiscuit)
function template
 
I've been working on this problem for a while and this error is trowing me off. Maybe someone can help point out what it means. thanks (14): error C2783: 'vo...
[5 replies] Last: where can I find the tutorials on this site? (by wjw25054)
what should this output?
 
Hi void f1( void ) { int x = 5; f2(x); cout << x <<endl; } void f2(int x) { x += 5; cout << x <<endl; } Im studying for an upcoming test and one of the...
[4 replies] Last: ahhh, makes sense, thanks. (by Omar Alamy)
Std list help
 
I am working with lists to store some data (waht an idea :) ), and have a few things I'm noticing that make me feel like I'm doing it wrong. first: void Effe...
[6 replies] Last: If you're worried about stressing the memory allocator by asking for l... (by Cubbi)
Saving inputfrom textfile to array element
 
char sisend_rida ; char andmebaas ; ifstream fin("andmebaas.txt"); // Andmete lugemine jadasse for(int i = 0; i <= 100 && ! fin.eof(); i++...
[3 replies] Last: Im trieing to help my friend with similar problem. Only difference is ... (by vastrolorde)
by badboy
An Example from Lafore book
 
Hello! Please explain why in listing below if variables are not initialized the compiler notificate an error? I mean these variables:int chCount=0;int wdCount=0...
[6 replies] Last: @Moschops Thanks. Now I fully understand this issue. (by badboy)
Concurrent C++ 11 mutex question (by example programm)
 
I Have made this programm which takes a global, and a 1st thread SUMS from 0 to 4 by a PARALEL_SUM ( int x, int pN) who creates 4 ...
[no replies]
program in dev c++ 7.4.2
 
Can anyone please tell me how to make a program in dev c++ 4.7.2. I made simple program which flashes an error #include<iostream.h> #include<conio.h> voi...
[1 reply] : "an error" is not a valid problem description. Do not use Dev-C++, the... (by Athar)
by dadih
how to calculate total amount using repetition if else
 
I can't calculate the total amount only for the selected menu..this is my coding..please tell me what i must do..example..here have 4 menu,i only want select 2 ...
[1 reply] : initialise the values of total=0.if you don't do so it will store a ga... (by Pter0dactyl)
Help with c++ homework please and thank you.
 
I can run the program but for some reason the average doesn't come out right and the numbers next to it don't match the test scores when they sort. // comp...
[1 reply] : // compiler directives #include <iostream> #include<iomanip> #include... (by ui uiho)
by irmako
compare two strings
 
Hi everyone I need to create function which compares two strings and finds maximum of them. I have tried this code #include <iostream> using namespace st...
[1 reply] : What is it that doesn't work? Maybe you have to include <string>. (by Peter87)
Dynamically Creating Objects
 
I am trying to figure out how to create object dynamically. I have a custom class which stores information from data files. I wrote the program to deal with onl...
[2 replies] Last: Yes, I can try to be more specific. I am doing data analysis on sever... (by vckngs7)
SDL key array strange behavior
 
Hello! i am trying to make my first pong in c++ with SDL. the game is running and you can play but i got two problems. The key array have a very strange beh...
[5 replies] Last: Oh, now i get what you mean! I will dig into some code now, Thank you... (by stoffe1100)
Game logic help
 
Ok so I'm starting a project with a friend of mine, that's a 2D game in Java actually, but the question should be universal. It's not really a syntax question, ...
[5 replies] Last: A target isn't going to enter the range of every tower at the exact sa... (by Lowest0ne)
help with random number generator
 
guys I'm new to C++. I need a help. I mean; srand((unsigned)time(NULL)); I don't understand this code. can anyone please explain me these codes individual...
[1 reply] : Computers work because of logic gates, because of this they cannot pro... (by closed account 2NywAqkS)
May 2012 Pages: 1... 4748495051... 59
  Archived months: [apr2012] [jun2012]

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