Beginners - June 2014 (Page 16)

by Asego
Stop timer when key is pressed
 
I'm trying to write a basic timer program for kicks. Everything works, but I can't figure out how to make the timer stop when a key is pressed. A specific key o...
[3 replies] Last: Argh. Do it the right way: http://www.cplusplus.com/forum/beginner/561... (by Duthomhas)
C++, Zany Zack, Arrays, and Functions.
 
I have been assigned the following problem: Zack the Zany (formerly the Employee of the Month) has been reassigned night duty at Super Club. Zack is back t...
[1 reply] : array = OFF; This does not set all the elements of array to off.... (by cire)
Find the array by element
 
Hi, Suppose I have some array. vector<obj*> vobj1; vector<obj*> vobj2; ......some more.... Now, I have a pointer of an element, but I don't...
[6 replies] Last: Pehaps a vector is not the most appropriate container type. If the ... (by AbstractionAnon)
by h4ever
unresolved externals - function already defined in file ... .obj (1,2)
 
Hello, I have some problem with unresolved external and cannot find out how this happens. I am on Windows Visual Studio where I have file stdafx.h which inclu...
[21 replies] Last: how to refer to the ERR_regex or ERR_regex_2 constant As keskive... (by AbstractionAnon)
Type Error
 
I am having problems with the types in this program for out putting a letter grade. Lines 39-67, and line 148 give me this error. I am wondering if there is a...
[8 replies] Last: Thank you! that totally works now. (by DEnumber50)
Simple question about headers
 
Hello ! I am reading my book's section on headers and I don't really understand why we need to have two files when needing to call a header in a main functi...
[4 replies] Last: Uhm, I believe you can define functions in a header file. Its just not... (by Jakee)
While( user == gullible )
 
I was just wondering is this a good way of writing the code for this exercise: While( user == gullible ) Requires: variables, data types, and numerical opera...
[3 replies] Last: When count is 0, count++ evaluates to the value before the increme... (by cire)
by zionet
We find two elements in an array of 100000 elements, which are subtracted coming to 0.
 
We find two elements in an array of 100000 elements, which are subtracted coming to 0. example: Input: -99 -2 -1 4 98 Output -1 -----------------------...
[3 replies] Last: ? Whats your code. The number is coming to 0. (by zionet)
OOD: Fetch available actions from objects?
 
I'm trying out Object Oriented Design to make a very simple text-based adventure game where the user is in a room and interacts with the objects in that room. I...
[4 replies] Last: ACTION_COUNT is the number of actions defined in one particular item... (by helios)
Program 13
 
Getting error when trying to compile #include<iostream> #include<string> #include<algorithm> #include<cmath> using namespace std; int main() {...
[6 replies] Last: Hm, I searched a bit the compiler issue and found this: https://gcc.gn... (by pacman169)
Need help with Macros
 
Output of the following program for "J" should be ++y * ++y = 2 * 3 = 6. But when I execute this program, I get Output as 9. I tried on several compilers (GNU G...
[7 replies] Last: > See below example O/P for cout operator All those are undefined beha... (by ne555)
Playing sounds
 
When I play a wav file sound with this code: #include <iostream> #include <windows.h> //I added a library called mmsystem.h using namespace std; i...
[13 replies] Last: What is a Hi Script ? (by BobTheZealotIsEpic)
Slash and 2 digit number entering
 
Hello ! I am having a small issue with my code, mainly I'm not sure how to do this. Basically, lines 79-82, where the user enters in their birthday & birthye...
[4 replies] Last: Thank you both very much for your help ! (by NookLines)
Typedefs and Define
 
What is the difference between typedef and #define ? Typedef: #include <iostream> using namespace std; typedef int hi; int main(){ hi a=1; cout...
[3 replies] Last: Thanks (by BobTheZealotIsEpic)
Atof or atoi
 
Hi guys, i've a problem. I don't know how to use atof or atoi in a bidimensional array. Basically i need lo make a list with names and family name, with three...
[7 replies] Last: This is a "find the student's average grade" homework. By "notes" le... (by Duthomhas)
Errors in 'hello world' C++ MPI program in Windows
 
Hello all, I am a scientific programmer but very new to MPI. I am trying to make classic 'hello world' program on Windows OS, gcc with code::blocks IDE or VC...
[2 replies] Last: Thank you very much for your answer. However can you speak in Windows ... (by a5997487)
MinGW Compiler or Compilers on Windows
 
I'm having a problem running MinGW. It is installed but won't run. I use the command prompt and type in 'g++ file.cpp' but it doesn't work. Any clues or ways t...
[3 replies] Last: http://lmgtfy.com/?q=set+path+in+windows (by keskiverto)
do loop only running once
 
I am writing a program to solve a quadratic function iteratively by having values of x converge, with the program solving for x until the difference between the...
[8 replies] Last: In one way that looks like progress, it is actually looping. But the c... (by Chervil)
New to C++, question about a code
 
I'm learning it on my own while I'm out here on deployment, and came across this problem: // Write a single 'if' statement that examines two integer var...
[3 replies] Last: Thanks guys, I'll try re-writing this with the ternary op just to see ... (by syntax error)
Don't recognise this for loop
 
Hi, I was going through Bjarne's book (Principles and Practice using C++ 2nd Ed.) and came across this for loop: double sum = 0; for(int x : temps)su...
[2 replies] Last: Ahh, thank you very much JLBorges. (by greenfox)
June 2014 Pages: 1... 1415161718... 48
  Archived months: [may2014] [jul2014]

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