Beginners - March 2015 (Page 40)

by c4l
Very basic help with string library related task
 
Hey guys, I have got a task for my programming class to make a program that would read a word like "2AXZ5Y" and write "AAXZYYYYY" and I can't get it to work. Ca...
[4 replies] Last: We only have to do it for integers from 2 to 9 for now. (by c4l)
Need some help cleaning up and adding a loop
 
Hey there, newbie here. I'm supposed to create a program that gives you a menu of problems. You choose a problem, it creates two random numbers and asks you for...
[4 replies] Last: You would insert it between your if statements. if (choice == 1) ... (by fg109)
class word in parameters
 
Hello, Could you please tell me why put the "class" word in front of Visitor* in the code below and why not just put virtual void accept(Visitor*)=0; ? ...
[2 replies] Last: It is optional in C++, as it is a carry-over from C - C++ treats the ... (by LB)
Error in the .h
 
When i build this code i get an error on the #include "GradeBook.h" //Definition ogf class GradeBook thyat determines class average //Member functions are d...
[1 reply] : "an error"? Should we say: "an answer" to match the level of detail? ... (by keskiverto)
Singleton Design Pattern QUestion
 
Hello everyone, I found this code for implementing a Singleton Design Pattern on WikiBooks. My questions are: - How could the GetString() and SetStrin...
[3 replies] Last: Hey great! thank you all for the accurate answers!! (by JasBeckC)
overloading operator<< for ofstream
 
This is the 1st program im trying to write somethink into .txt file but at 1 point operator<< overloading is not working. Why is that so? struct Point{ do...
[5 replies] Last: Thanks for answers guys :) I checked this version of code out and now ... (by etrusks)
Zork-esque game : Am I using if() correctly?
 
I am currently working on a zork-like game where a character is confronted with choices (mostly yes or no, or left or right) that helps move the character on th...
[4 replies] Last: Thank you sir. I appreciate it. (by supasonicsquid)
A Lil point of sales
 
During the past few days I've been trying to write a small point of sales program and at the moment i got it to work kinda :\ but it has one little error the t...
[3 replies] Last: I don't see any code to input the purchase. - add code after line 25 t... (by dhayden)
cannot open file /libgcc/unwind-sjlj.c
 
Hi there The brief is to output prime numbers consecutively into an array that can be used later or elsewhere. If I run it with '15' as the required number o...
[2 replies] Last: Thanks tipaye, those two changes fixed it. The ' candidate = back_va... (by jeremiahwuzza)
Do they yield the same result or different?
 
Do they yield the same result or different? 1. bool tf; int n; if(1) tf = true, n=2; //plz explain this.. tf=true, 2. bool tf; int n; if(1) {tf = ...
[3 replies] Last: The comma operator is a special operator in C++ that evaluates all arg... (by LB)
Matching Arrays Problem Help me please!
 
Hi I'm trying to write a function that will match the values within an array and the other; for for example.. if I have an array of size 16 called dimT=16 a...
[3 replies] Last: thanks for answering! It's been extremely helpful! =) (by dirtymind)
Connecting Array with Date
 
My program starts with user entering rainfall amount. Then sorting the array in descending order a using selection sort algorithm. Then displaying the result Th...
[2 replies] Last: if (minIndex != i) { tmp = water .rain; water = water ; ... (by tipaye)
by vixdew
Trouble with dynamic arrays, structures and functions
 
I'm having some trouble with a dynamically created struct array, in that when i try to use it to copy its concents to another dynamic array so that i can return...
[2 replies] Last: addFriend() is leaking memory like crazy. You're storing objects of pe... (by tipaye)
vector without name ==> vector<double>(24,-7777)
 
Hi im having problems understanding this syntax vector<double> hour { vector<double>(24, -7777) }; I understand what vector<double> hour {-7777. -7777 ...
[4 replies] Last: WOW, these answers were great. Thanks you guys very much, now everythi... (by etrusks)
Read character to int without crashing (1,2)
 
In C, is there a relatively simple way of stopping a program from crashing if a character value is entered into an integer variable?
[21 replies] Last: That makes sense now, thanks. (by Bogeyman)
HELPP plz! program that prints the cost of a call.
 
Write a program that prompts the user to enter the number of minutes a telephone call lasted for. The program finds and prints the cost of the call. Assume tha...
[6 replies] Last: In C Simple and Neat :) #include <stdio.h> #include <conio.h> int ma... (by Subscriber360)
Difference between pressing space and enter while giving input
 
Please explain.. Say I'm giving 7 8 9 as my input.. 7 "press space" 8 "press space" 9 "now press enter" you get the output as 789 now 7 "press enter" giv...
[2 replies] Last: Thanks LB! (by Knightrider29)
by JB5056
Is this an example of c or c++
 
I found references to a c programming problem nearly identical to this one and cannot seem to find anything even remotely close to this in c++ Write a program ...
[10 replies] Last: #include <iostream> #include <cctype> char translate( char c ) { ... (by JLBorges)
by Sym8
checkout program issue
 
so this is a checkout program. the problem i have is that the program doesnt work with the other PLU numbers only the 1st one. any thoughts on how to fix this? ...
[16 replies] Last: ok thanks for all your help :) (by Sym8)
Question
 
Can somebody check my evenSum in line 29 i dont know whats wrong #include <iostream> using namespace std; void askValues(int num , int max); int evenSum(int...
[1 reply] : The if statement should be inside the for loop, not the other way arou... (by LB)
March 2015 Pages: 1... 3839404142... 51
  Archived months: [feb2015] [apr2015]

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