Beginners - February 2012 (Page 19)

functions and length of arrays
 
Hello everybody, I am trying to write a program consisting of two parts: 1. It lists of letters before and after a certain letter (if the user requested 2 ...
[8 replies] Last: also, i used strtok_s instead of doing char for each word, so it is mu... (by hitholdir)
A Vote Tallying Program
 
So I'm working on a program which finds the highest number of numbers in a vector. It may be lengthy, but that's just because its easier to put different functi...
[2 replies] Last: Huh. I should have noticed that! I intended that to be redundant, but ... (by closed account yCf9216C)
Switch and Nested if/else Statements
 
I have to write a program with a menu displayed like this: (1) Carbon monoxide (2) Hydrocarbons (3) Nitrogen oxides (4) Non-methane hydrocarbons Enter polluta...
[12 replies] Last: I've only used iomanip for displaying significant figures or decimal. ... (by molecularman)
Void Functions
 
I've written a simple void function (provided below), and I had a very simple question that I'm not sure about. In my function I'm referencing b, PHI, PHIa, ...
[6 replies] Last: r and r2 are actually arrays where M, N, and h are integers and doubl... (by AliMoradi)
can anyone find the error in my programming?
 
// ------------------------------------------------------------------ // File name: grades.cpp // // Assign ID: PROG4 // // Due Date: 2/21/12 at 11p...
[13 replies] Last: got the problem with the data handled // --------------------------... (by byronflds)
SDL Mixer
 
Could Someone please help me install SDL mixer! Please. I really need it. All I need are some instructions.
[no replies]
Doing an "if" only once
 
I'm trying to only access the if statement for the first print-out and the rest of the print-outs will be within the else statement (this whole thing is within ...
[1 reply] : you should declare bool n = true outside of your loop. that way, when ... (by timmyyyyy)
Reverting to an earlier function
 
I was wondering on how to make a if statement repeat back to itself using a bit of code such as: int x = 0; while(x > -5){ //bit of code I do not know ...
[7 replies] Last: Ok thank you (by Pirogun)
Very new to c++ help writing code
 
Im very new to c++ and I was wondering if anyone could help me write it. Im not saying do the whole thing for me but help me start it and understand it. Thanks ...
[3 replies] Last: int main () { // Local Identifiers int Hours, Minutes, TotalMinutes; f... (by timmyyyyy)
Learning c++
 
Hi all , I am new to c++ and have set myself a goal of spending most of my spare time to this task for the next year ! To be honest most people i have told ...
[4 replies] Last: Loops are useful tools. Arrays are useful tools. Both are highly proce... (by ciphermagi)
Strange FSEEK and FPUTS results.
 
I'm using 'fseek' and 'fputs' to edit the contents of a text file. Below is the code I'm using. It basically searches the file for the line that contains ABCD...
[3 replies] Last: Never mind. I don't know what I thought about. (by Peter87)
Anyone see the problem in my code?
 
What its supposed to do is when you look at the closet you find the key and escape but if you dont check the cupboard you will die (yeah yeah i know its random...
[5 replies] Last: i finally got it it was exactly as Moschops said and i forgot to use ... (by chiritso)
How to capture a newline?
 
Just as getline (cin, string x) captures the whole line instead of stopping at a newspace char (as cin >> does) how can I capture a newline character. If it hel...
[no replies]
Try-catch
 
I have finished this code that is supposed to remove an from an array if it within the number of strings in the array, otherwise it is supposed to throw an exce...
[2 replies] Last: I feel like a fool now. Thanks for replying, I have fixed it. (by cdseasholtz)
Function overloading. Help..
 
This code won't compile unless I gave the last two functions (which take char strings) different names. I tried finding what's wrong for an hour but couldnt... ...
[2 replies] Last: These two definitions are identical. Only the names of the second para... (by vlad from moscow)
Palindromes
 
Hello all, I am having a bit of trouble with a program I am writing to check if a file that first has the length, then the content contains a palindrome. ...
[6 replies] Last: I would certainly like to do that, but the problem is that I cannot ch... (by Orangejuice)
Trying to make a library
 
Hi. I'm trying to create my first library. I have the following header file I created, called mylib.h: #include<sstream> #ifndef MYLIB_H_INCLUDED #defin...
[4 replies] Last: I started a new project and selected Dynamic Link Library. Then I wrot... (by CJC0117)
Ending a loop by pressing 'return'
 
I've been looking around trying to see how to end a loop by just pressing enter, or essentially a blank entry. The idea is that the user will be entering a proc...
[2 replies] Last: You can use the following code while ( std::cin.peek() != '\n' ) ... (by vlad from moscow)
by Moosey
Saving the 'State' of a Console Program?
 
I have searched the forums and google but have come up empty. Basically what I need to do is when the player inputs 's' I need it to save the current positio...
[2 replies] Last: I am actually probably going to focus it similarly to one of those 'ch... (by Moosey)
To check whether a number is prime or not in c++
 
I did not understood this program /*program to check whether a no is prime or not prime*/ #include<iostream.h> #include<conio.h> void main() {int n,i=2,...
[1 reply] : I will try to rewrite it. Maybe it wiil be more readable. #include... (by vlad from moscow)
February 2012 Pages: 1... 1718192021... 64
  Archived months: [jan2012] [mar2012]

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