Beginners - February 2016 (Page 36)

determining a length of a string inside a vector of strings
 
say I have a vector of strings: vector <string> words = {"you", "are", "pretty"}; is there a way to calculate the length of the word "you" inside that v...
[2 replies] Last: size_t len; len = words .size(); Note that std::vector is not an ... (by AbstractionAnon)
by nj1995
Problem with Multiple File Compilation
 
Hi,whenever I compile and run my program it fails giving me the error recipe for target 'containerl.exe' failed #ifndef CONTAINERL_H #define CONTAINERL_H ...
[4 replies] Last: oh okay thank you! i did not know that, that was the problem. Thanks a... (by nj1995)
Score the race
 
Some number of teams are participating in a race. You are not told how many teams are participating but you do know: -Each team has a name, which is one of the...
[1 reply] : how would I split each character out of the string and into an array?... (by Moschops)
Deleting from an array
 
Hi all, my array has a max size of 10 places; and it contains a string, Im trying to delete a letter chosen by the user. It almost works just my problem is if t...
[2 replies] Last: Your problem is that when you delete the first letter, you're doing tw... (by AbstractionAnon)
Help
 
I am writing a code that needs to ask a user for their name in the order of " Last, First I. " and returns it as " First I. Last " and I need help. #inclu...
[1 reply] : http://www.cplusplus.com/reference/istream/istream/getline/ (by cire)
by m0bb1n
How to go back to functions without explicitly addressing it
 
Hello, I was wondering if I could go to a function from another one without explicitly addressing. For example I am in the hello() but I want to go to bye(). ...
[1 reply] : Well, when the bye() function terminates, it will return you back to t... (by Ispil)
Error ')' Before string constant
 
What should i do? Here's my code #include <iostream> #include <cstdlib> using namespace std; int main() { while (1) { char choi...
[3 replies] Last: Are you possibly looking for something like this? #include <iostream... (by newatthis)
by josex
C++
 
Hi I need to do the following in C++ but I have no idea what I am doing. Here is my problem question. Write a program that takes calculate the magnitude and a...
[4 replies] Last: Thank you so much for your help. Dhayden, yes the calc is in a single ... (by josex)
Algorithm ideas for this problem?
 
I have a series of values in chronological order. I need to calculate the mean of a specific percentile range (say, 60% to 80%), then remove the oldest value, a...
[no replies]
Having trouble with Random Number Guessing Game
 
Hello guys I am currently in an intro computer science class, I am currently having trouble with an assignment, it is a random number guessing game, the gues...
[9 replies] Last: I don't know if it's too late, but here is what I came up with. #in... (by newatthis)
How to x.find(*any element from array*)
 
On the sole purpose of learning i've created this simple program that recognizes two possible beginnings of user inputted strings and answer accordingly. On the...
[3 replies] Last: std::find() is the droid you are looking for I see that you have... (by Duthomhas)
find specific line in txt file.
 
...
[2 replies] Last: Since the date field is at the beginning of each line, you could read ... (by Chervil)
by vaynex
Comparing Values with Different Data types and getting the largest value
 
Right now my program works but I would like the program to return the fielddata .Field value with the highest Yph value. FieldID are int's and Yph are floats ...
[8 replies] Last: Slightly different from Cervil's suggestion, I'd just maintain a varia... (by dhayden)
by reduxe
Mean, median and mode in arrays
 
Hey guys, I need a bit of help with arrays. As far as we have been taught, I'm still at the level of array initialization. Now we were tasked to code a pro...
[1 reply] : Please note that this is not a homework site. We won't do your homewor... (by keskiverto)
[SOLVED]pugixml parsing
 
Hi, I have an xml file like this- <char> <npc> <item> <obj bottle="blood" /> <obj bottle="mana" /> </item> ...
[1 reply] : got it :)). (by Turbo82)
replacing char in a string.
 
Hey guys, so in a bit of a bind, and my project is due in a few hours. I know there is a way, but all of our school tutors are not online. So, the issue is, I n...
[1 reply] : #include <iostream> #include <stdlib.h> #include <string> using nam... (by Thomas1965)
by vc98
Array Problem
 
Hello I am writing a program that gets the minimum(xmin) and maximum value(xmax) of x from the user and then evaluates an equation over the range of values betw...
[6 replies] Last: Ok, just spotted the pesky semicolon on line 22 :+) (by TheIdeasMan)
Anything unnecessary or able to be improved in this code?
 
This is my first post to the forum, so apologies if it's in the wrong forum or even a useless question, but I've only been coding for about a week and I was won...
[3 replies] Last: Thanks guys I'll try all of the suggestions, have a good one. (by ChangCow)
Convert to upper and back
 
So I have to create a program that take a string and brings it toupper then brings it back tolower however I cannot get it to do both. // ConsoleApplicati...
[14 replies] Last: No jib that is not what the program calls for sMav that is great for ... (by theotherguy8883)
by vaynex
data from file into array of struct
 
How do i take the data from the .txt file and enter it into the array so that I can use it in the loop below. here is the data in the text file {1,0,7.4,39...
[6 replies] Last: Your code is mixing two different variables. One is an int, the other ... (by Chervil)
February 2016 Pages: 1... 3435363738... 46
  Archived months: [jan2016] [mar2016]

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