Beginners - September 2016 (Page 22)

HELP!!!
 
How do you give a value to each element in a string c++. Where I want this part: "What is 1+1?" is equal to 1 #include <iostream> #include <string> #include...
[5 replies] Last: At first I got errors because of namespace std, it solves the problem.... (by LemonHappy)
Load data using member function.
 
The person class should have the following functions: • Constructor(s) • Destructor - optional • Get - read first name, last name, and age from an input s...
[no replies]
Drawing a w-wide h-high rectangular frame using asterisks
 
My lab is basically prompting the user first for the width and height, then using asterisks to draw it, Kinda lost as to where to go from here, Super beginner l...
[no replies]
I need help, kind of lost and my book isnt helping.
 
The problem is: A car with a 20-gallon gas tank averages 23.5 miles per gallon when driven in town, 28.9 miles when driven on highway. Write a program that calc...
[4 replies] Last: oh wow thanks guys that worked. (by JSwizzy)
Help with Dice Roll!
 
Ok here goes a better explanation, thought comments would help. I got this exercise I needed to fill in and I'm pretty much done with everything except the last...
[no replies]
Problem with reading from FILE*
 
int main(){ vector<string> strs; FILE* f = _popen("tasklist", "r"); char str ; while (fgets(str, 90, f)) { strs.push_back(str); } for (string& ...
[3 replies] Last: What a shame, that was the problem indeed. It seems the first string r... (by Guzfraba)
Just will not work! (1,2)
 
Can't figure out why this will not output report. #include <fstream> #include <iostream> #include <iomanip> #include <vector> #include <string...
[28 replies] Last: I am surprised to hear those functions work at all. I was convinced th... (by greengirl1968)
isdigit and isalpha
 
My question is about the isalpha() statement. I know that the islpha is to check if it is a char but, i get errors in the for loop. How can i resolve this probl...
[2 replies] Last: Line 32: line.begin(), line.end() return iterators, not ints. Theref... (by AbstractionAnon)
Reading from binary file to vector of uint8_t?
 
Hello everybody. i'm trying to read a binary file directly to a vector of uint8_t, but its not working. it gives me no error, just don't read anything. heres'...
[11 replies] Last: oops, you are right! sorry, i confused myself! thank for the help, now... (by Stauricus)
getline
 
When using the getline function, what do I need to do to to get line 1 and then again to get line 2?
[3 replies] Last: Lines 4 and 5 of the snippet I posted, change cin to infile. (by AbstractionAnon)
Erasing front of string
 
I need to read in from a file that looks like: 1: Name 12: Name 123: Name . . . 12343: --End of Data -- I need to output the Names without the numbers and col...
[3 replies] Last: Thanks guys. I knew it was something I was thinking too hard about. ... (by govCode)
Why is this the output?
 
Hi :) I understand if this is something no one might want to help with. But I was hoping to get a clearer understanding of why these questions have a certain ou...
[6 replies] Last: Wow. I was making this more complicated than it needs to be. I underst... (by Saibachick)
Private vs. Public data members
 
Hi everyone, It seems that there are more or less strict rules about whether to keep data members private or public. I was told that the data should be stric...
[1 reply] : isn't it as risky and error prone to give access to data through func... (by AbstractionAnon)
animate function Jquery
 
I am trying to write a program to create a carousel of images. I understand the animate function, but when looking up an example I saw one person write the cod...
[1 reply] : Hey infinitesimalGuy, If the heading and the code do not tell you wha... (by Handy Andy)
Text Adventure Movement
 
I've been trying to make a text adventure game where your position is determined by a changing variable that represents your location. (V=0) is one room and (V=...
[2 replies] Last: You start with V = 0 (which should be an int). If you move NORTH, V be... (by AbstractionAnon)
how to use dlopen with C++ class object
 
I have shared library that has class and class methods I want to load this shared library at run time using dlopen , Can some one can tell me basic exam...
[5 replies] Last: In the above code is there any case where getA() can return a NULL po... (by AbstractionAnon)
by JJ2828
S
 
111
[2 replies] Last: Yes!Thank you! (by JJ2828)
How to sort a list with objects.
 
Hi guys, I have a problem, I wanted to sort the numbers of ingredients. I tried several methods but have not reached a result. I've searched on the internet, I...
[7 replies] Last: [quote=TheSmallGuy]P.S : std::list::sort() does not seem to be well su... (by keskiverto)
by mwapy
This was simple in Fortran, but...
 
I am new to C++ and can't seem to resolve these issues. Part 1: Need to get DIFFERENT inputs, why not works? Or an alternate method. I just want the inpu...
[8 replies] Last: If you have multiple values (perhaps runtime-determined amount), then ... (by keskiverto)
Trouble seperating file into multiple classes
 
I'm trying to separate this program into different files: bike.cpp, bike.h, wheel.cpp, wheel.h. If I leave everything in one file it compiles and runs fine, bu...
[5 replies] Last: Either you have put main in the wrong file (it should be in what is c... (by keskiverto)
September 2016 Pages: 1... 2021222324... 34
  Archived months: [aug2016] [oct2016]

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