Beginners - September 2014 (Page 19)

superstring question
 
Write your question here. this is my code about search substring in a file. but i need to change it to search superstring, which means s is a superstring of t...
[1 reply] : if ( s.find(t) != std::string::npos ) { std::cout << s << "\nis a... (by MiiNiPaa)
What does the cin.get() do?
 
What does the following line of code do? cin.get(); From my understanding it stores any characters including spaces and tabs but is there more to this m...
[1 reply] : Reference is your friend here: http://en.cppreference.com/w/cpp/io/ba... (by MiiNiPaa)
Call to a function
 
Helle, i need a function printsresults, not a member function, to print out final couts. I don't understand how to call that function from the main and what par...
[4 replies] Last: so you need a function that takes in the object as a parameter? voi... (by novellof)
by davez
the Ternary operator
 
Can someone teach me how ternary operator works i really cant understand it. Thanks
[3 replies] Last: Whoops, typo. Thanks for noticing. Fixing it. (by MiiNiPaa)
help!!!
 
how do i go about getting ride of the "-" in the numbers? 1) Write a program prompts a user for a telephone number that requires only one dash in betwee...
[3 replies] Last: How did you solve the problem? Did my post help you? Please let me kno... (by novellof)
by swivel
Comparing elements in the same array
 
How do I write a function that will compare the elements in the array? Example: my array is 1, 2, 3, 4, 5. I want to compare if 1 = 2 1 = 3 1 = 4 1 = ...
[2 replies] Last: Your question is so vague. Why would you compare if 1 = 2? (by DeathLeap)
Implement Arrays
 
Hello, im trying to implement an array into this program. Could you give me an example using the name variable so i'd have a sample for the rest. #include <i...
[1 reply] : const int NUM_NAMES = 5; string names = {"name1","name2","name3","n... (by novellof)
Help!!!
 
I'm trying to figure out what I did wrong with this while loop. I want the program to run until the user inputs "$." char letter; cout << "En...
[3 replies] Last: What is wrong with your loop? What is your issue because it works for ... (by novellof)
&& with strings
 
So using "&&" gives me an error no operator "&&" matches these operands. Can you not compare strings? Help please? #include <iostream> #include <strin...
[2 replies] Last: OHHHH. Such a stupid mistake. Thanks (by Extreme112)
Cant create class object
 
I'd like to create an array to accept student' names. Why cant I create the class object Quizdata student ; ? #include <iostream> #include <iomanip> #inc...
[1 reply] : In your class you need to name the arguments: class QuizData { ... ... (by hyperfine)
finding a range between period dates in an enum
 
UPDATE: SOLVED. I had problems trying to figure out the correct for loop math, but I figured it out! If anyone else needs help you can review the code ...
[19 replies] Last: For some reason I thought I needed to make another function for the en... (by tamirat)
Help me
 
i wrote a program that calculates how much someone made in a week. the calculations are almost correct. What formula should i use to make the program show the a...
[1 reply] : the worker has 2 dependents what formula to use if it has 3 or more de... (by sammweout)
Midi Note Calculator
 
Hey guys, I am new to this forum and love it so far. I am attempting to write a program where the user inserts 2 midi notes between 21 and 108 and calculate the...
[2 replies] Last: So what is wrong with my math here? n[ i ] = i + i^(1/12) for each st... (by adventureaudio)
How to exclude a number from command 'for'?
 
Good night, everyone.. Just wondering how do I exclude a number from command for 'for'? For an example: for (int i = 0; i < 9; ++i) - Except for i = 5? Th...
[3 replies] Last: What are you trying to "make work"? Your code there seems to be a diff... (by Ganado)
Need help
 
I need to write a C++ program that performs a basic arithmetic operations including addition, subtraction, multiplication, and division. The expressions ar...
[2 replies] Last: When I am unsure how to get a program started, I try to answer the fol... (by squished18)
Using a Scanner to read input from file to vectors
 
I have an input file that is made up of two lines with one sentence on each. My vectors: sentence1, sentence2 The input file contents: this is the first ...
[10 replies] Last: This is one of the first C++ programs ive ever worked with so im still... (by spotzform)
Help
 
Write your question here.ok so i did a program that will take the number of hours worked in a week annd the number of dependents ans inputs and then outputs the...
[5 replies] Last: can you run it and see if theres any other errors? im trying to get ri... (by sammweout)
Overloading operators to accept array of objects
 
I am trying to overload "==" so I can compare two arrays that holds objects. I am suppose to compare the id numbers of the Student objects. This is the object ...
[12 replies] Last: Nikko YL 1.I changed the static, you are right about that. Thank y... (by FlyingTr)
Simulation - Stepping out of bounds?
 
I am writing a simulation program. In the code below I am using cout << action << endl; to test. I am getting some action results to be outside of the array...
[3 replies] Last: Yep, I missed that one. Thank you. The reason I hard coded so many nu... (by jdwright)
by versa
if statement help
 
I am having trouble with this part if (choice == 1){ cout << "Please enter the radius of the circle: "; cin >> radiusofcircle; areac = 3.14159 * radiusof...
[8 replies] Last: Thanks everyone for the help i just changed (areac <=0) to (radiusofci... (by versa)
September 2014 Pages: 1... 1718192021... 51
  Archived months: [aug2014] [oct2014]

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