Beginners - February 2014 (Page 53)

string variable needs to be const char
 
I am writing a simple program that asks the user to enter a file name then the program counts the number of files. I have gotten the body of the program to work...
[1 reply] : Two options: The preffered option is to use a c++11 compliant compile... (by TwilightSpectre)
I need you guys!...again
 
I'm writing a program for calculating the circumference of a circle being entered by the user....only problem is...hypergrade won't accept it. I'll pot a screen...
[10 replies] Last: No worries, pleased to help :+) Also, there might be a M_PI already... (by TheIdeasMan)
Can someone please explain this...
 
Ok so I was trying to better understand the use of %= so I wrote the following: #include <iostream> #include <string> #include <cmath> using namespace st...
[1 reply] : First, you are performing operations with a and b before they have bee... (by TwilightSpectre)
problem in function
 
this program is designed to get input in the buffer via DOS input redirection. the problem i'm having is that when the function WordLength is called it becomes...
[no replies]
Write a program that calculates the distance between two points (Please help me edit)
 
Write your question here. #include <stdio.h> #include <math.h> int main() { float x1; float y1; float x2; float y2; float Distance; x1 = 7; y1 = ...
[4 replies] Last: @IdeaMan, I'll keep that in mind! I'm currently working on my last pro... (by Kevin15663)
by combzy
Calculate Bank Charges Help
 
This is an simple program that is supposed to prompt the user for the beginning balance and the number of checks written and then compute the service fee for th...
[4 replies] Last: Thank you for your help, it really helped me understand what to do and... (by combzy)
HELP! Vending Machine Program (C++)
 
Where to begin, well for starters I was originally supposed to create a vending machine program that allowed a user to enter 4 products (names and prices) and I...
[1 reply] : I would read the entire file into memory. Then operate on the data in ... (by Garion)
nested for loops
 
I have to make this program input from a file "puzzle.txt" which contains the matrix size and word puzzle contents. For example the input would be: 5 8 h...
[4 replies] Last: I believe all that I need to figure out now is how to get my program t... (by bknick24)
by Coxxej
declaring functions
 
Im really confused with these.... whats does i mean and what does ! mean in c++
[1 reply] : If you need help with functions, this website has a good tutorial that... (by geniusberry)
store a 256 bit number into 64 bits
 
I have to store a 256 bit number into 64 bits like a number in 256 bit array to 64 bit array unsigned int arr_1 ; //each location containing 32 bits I have...
[7 replies] Last: Otherwise you will have to specifically bit-shift the numbers out: ... (by Duthomhas)
[error] 'variable' previously declared here
 
This is just a simple distance per tank calculator given fuel economy for variables. Exactly what does this error mean in relation to my code? ---- 'double tot...
[3 replies] Last: Got it, thanks! (by justin00)
C++ cout~text~ if (int<=)
 
i want it to say sorry you have died if health is equal to or less than 0 and close the program. so if answer is 3 health is 0 and if health is 0 say you have d...
[10 replies] Last: @SloshyFob: See this thread: http://www.cplusplus.com/forum/beginner... (by Disch)
by alsade
reversing array of char's issue
 
can someone plz tell me why the reverse function doesnt reverse the array? #include <iostream> using namespace std; class my_string { char* ptr; int size;...
[6 replies] Last: Q: What is wrong in this picture? char * my_string::ptr; my_string::m... (by keskiverto)
Having trouble with random number guesser
 
There were some weird things going on I am using microsoft visual studio 2013 I have done some programming before and am somewhat experienced I see nothin w...
[2 replies] Last: Also generally speaking you should get a seed before creating a random... (by giblit)
by thepox
Getting no output...
 
Write your question here. #include <iostream> using namespace std; int main() { double propval; cout << "What is the actual value of th...
[3 replies] Last: Hmm, I thought using std::cin would flush std::cout automatically but ... (by Peter87)
primes/logic error
 
#include <iostream> using namespace std; int main () { for (int i=2; i<100; i++) { bool prime=true; for (int j=i; j>1; j--...
[2 replies] Last: Thanks :) (by Fauch911)
by fi50
Dynamic Array Help
 
Hey. I was just wondering whether the code shown below is the most effective way of increasing the size of an array, or whether it would even work at all. ...
[3 replies] Last: You can also return variables by reference using the ampersand (&) cha... (by kevinkjt2000)
Counting Objects and methods
 
Hello, first time posting, thank you for your efforts in advance. I have a program right now that counts all of the lines of code excluding comments and blank ...
[9 replies] Last: Okay, so I have gotten it working as far as counting total LOC. Gibli... (by cory244)
by xpg94
Ifstream character problem
 
This is what I'm trying to do: "Write a program which prints a table listing the number of occurrences of the lower-case characters 'a' to 'z' in the file "Shee...
[1 reply] : Maybe this might help: for(char ch = 'a'; ch <= 'z'; ch++) { std:... (by kevinkjt2000)
inputting from file stumping me
 
I am in the process of making a puzzle that inputs to the program comes from a file. The file contains the matrix size and word puzzle contents. The program sho...
[3 replies] Last: If that code were legal, you would still be accessing nonexistent elem... (by cire)
February 2014 Pages: 1... 5152535455... 60
  Archived months: [jan2014] [mar2014]

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