Beginners - November 2012 (Page 29)

Adventure never ends
 
I need this adventure to end after the player has done enough, but it refuses to stop after the end. #include <iostream> #include <string> #include <cctype> ...
[3 replies] Last: Also, should I use the choice1 check loop for the other choice inputs ... (by Goraan2012)
C-style character array
 
I am new to computer programming and have to write a program for class that accepts a line of input and then does character analysis on that input. My program ...
[no replies]
by Tate
Output for Array Not Displaying Correctly
 
My program works but I can't figure out how to construct the array to display the output correctly. Here's the INPUT : Heights : 62 61 59 64 60 54 57 5...
[2 replies] Last: Awesome! I made a few changes to the code you suggested and it worked... (by Tate)
Recursive functions
 
This is my function, it compiles but when i run it, comes out as testing power, segmentation fault. it is suppose to print 3^9= 19683 #include <iostream> ...
[2 replies] Last: Thank you! It worked! Can you help me out with this one also? This is ... (by chiquitina21)
How to fix this error?
 
I have wrote the following program: #include <iostream> #include <iomanip> #include <string> using namespace std; const int DIVISIONS = 8; double...
[6 replies] Last: The reason you're always getting 7 is because in the for loop in findH... (by Thumper)
Where am i going wrong????
 
i have just created this program for a basic calculator. If you run it, you will see what is wrong. When user enters 0 it is supposed to finish. #include<ios...
[7 replies] Last: thank you :) so how do i set the accumulator to the first value entere... (by brucey2343)
Parallel Arrays
 
Hi; If you use parallel arrays to input an address for a phone directory program. Such as this Walter J. Freeman 8752 W. Miles Rd. Adrian Mi, 48719 517-42...
[10 replies] Last: Dude It says parallel arrays I emailed my instructor and he said struc... (by jlillie89)
help with breaking up an integer into an array and overwritng a file
 
#include<iostream> #include<fstream> #include<cstdlib> #include<string> using namespace std; int main() { const int stid = 20102265; string ifil...
[4 replies] Last: you're right i did what you said and set it and did % ect to break up ... (by clusich)
expected init-declarator before "char"
 
I'm basically the noobiest C++ person ever. I got this error while doing a program... and I googled around trying to figured out and it said that I may have an...
[3 replies] Last: In the future, if you need to post code, use the code tags: [ code]Co... (by Volatile Pulse)
Streams as arguments to functions?
 
So I'm trying to write a program that gets a whole bunch of numbers from a file called 'mean.txt', and find the average. I've tried sending the stream called 'i...
[3 replies] Last: But what if I wanted to use multiple namespaces in a single program? ... (by Moschops)
Get/Set Problems using reference and const...
 
Hello all - fairly new to C++ - my second college class on it and I am usually great about being able to google-foo my way thru things I get stuck on but this h...
[6 replies] Last: One last thing... I initially had this method like this before I chang... (by respawn22)
BMI calculator!!
 
okay. First thing first, I am a beginner who just got into ADTs and polymorphism. And second, the program is not complete, I just completed first part of it and...
[6 replies] Last: cout << "your Body Mass Index is:" ; cout << result -... (by MinwooJu)
by Hotice
Searching dynamic memory for a string literal.
 
I have a project where I am supposed to make a program that generates the object code for the lines in an assembly program (in the form of a .txt file), and I h...
[18 replies] Last: I didn't want to use vectors because the the algorithmic complexity ... (by Cubbi)
drawing a Shape using RECURSION as a mirrored shape.
 
i need to draw a shape using recursion and it must be like a mirrored shape like this **** *** ** * ** *** **** i knowe how to do it with for loops but...
[11 replies] Last: hi again i asked my teacher today and she told me you have to use one... (by Reema Alqerm)
Will this tell me if the next char in a file exists?
 
I need to find out if the next char in a ifstream object is the eof without extracting it. Will this work: ifstream ptext ("dog.txt"); if (ptext.peek(...
[3 replies] Last: Not a problem, ptext.eof() will only test if the file stream is EOF. y... (by LGonzales)
by OGRE2
Problem with Two Functions Using Arrays and Pointers
 
Function a: This function must accept as arguments the following: A)an array of integers B)an integer that indicates the number of elements in the array Th...
[1 reply] : double* median (int array[ ], int size) { int size, *median; N... (by Moschops)
Scripting languages
 
What are scripting languages used for? I want to learn python but I don't know what it is for. Is it like C++? I've heard it is quite easy. Thank you.
[5 replies] Last: k, thanks all who answered. (by closed account LN7oGNh0)
skipping inputs
 
does anyone know why my program skips the zip code when i enter a date in the form of 02/05/2006 but works fine with 02 05 2006 #include <iostream> #includ...
[4 replies] Last: You could use getline to specify that the delimiter is / and then wo... (by Moschops)
by marhit
string.find or string.substr?
 
I have to write a program that accepts a 7 character string of numbers and letters, such as 123b456. The fourth character has to be a b,g,r,or w. Then If the en...
[4 replies] Last: Many ways to do this Here is one; #include <iostream> #include <st... (by SamuelAdams)
Lvalue error.Help!!
 
strcpy(sendbuffer,(char*)&this); I wrote the above statement in a member function of a class but it shows an error "lvalue required as unary '&' operand".se...
[3 replies] Last: @hamsterman u were right thanx for the help.thanx to peter87 too. (by Pter0dactyl)
November 2012 Pages: 1... 2728293031... 75
  Archived months: [oct2012] [dec2012]

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