Beginners - February 2016 (Page 39)

Beginner C++
 
Need to learn C++. Exactly with what to start I need to know what to start doing to learn C++. I have learned some beginner tutorials like(strings variables...
[10 replies] Last: http://www.learncpp.com/ It has exercises at the end of each lesson. (by RUNNER PRO AGARIO)
Read stdout from another console application
 
Is it possible to get stdout data from another console application? Or, run two consoles from one c++ program?
[3 replies] Last: Start a command prompt and type dir \windows | more This will execut... (by dhayden)
inputting into a 2d char array
 
The assignment is to read from a file, put the first two words into a single row of a 2d char array, and the next two numbers into a separate array. My issue is...
[5 replies] Last: I suggest you stop using C-strings and stick with std::string: std::... (by jlb)
Vector to vector without repeating elements
 
Basically, I have a vector with 10 elements, and I need to create another vector with 6 non-repeating elements, taken randomly from the first vector. Kind of li...
[7 replies] Last: Sorry, I assumed that your source vector has no duplicates. (by Duthomhas)
Printing symbols using a for loop
 
Hello! I am taking my first ever coding class, and we are using C++. I kind of understand how a for loop works, but not for the purpose that I am trying to acco...
[4 replies] Last: That's exactly what I needed. I ended up figuring it out on my own, bu... (by Skorchy)
calling a class function in main but it's declared in it's own cpp
 
in my class.h i have. class AddressBook { private: string firstName; string lastName; int streetNum; string streetName; string city; string state; ...
[1 reply] : setFirstName(temp); You need an object to call the function., like:... (by Thomas1965)
What is the purpose of the auto keyword?
 
I understand that auto can be used with functions that have return values, but why do people use them in things like for each loops. Wouldn't typing the data ty...
[2 replies] Last: Great Article, Thanks Cire! (by RUNNER PRO AGARIO)
by Anybus
Question about strings!
 
Hello I have a question! Let's say that I have : std::string words = { "guy21", "town6", "1street" }; How do I get the numbers 21,6,1 out as int so that I...
[3 replies] Last: #include <string> #include <vector> #include <iterator> #include <sst... (by DeathLeap)
Vector of string to Vector of Char
 
let's say I have a vector of string: vector <string> words; this vector contains the words: you are pretty How can I convert these two words into a vector <...
[5 replies] Last: Here's another way to do it. #include <iostream> #include <numeric> ... (by cire)
Difference between two programs
 
I've been messing around with my code from this topic cplusplus.com/forum/beginner/182322/ until I managed to get it to work #include <iostream> #include...
[2 replies] Last: Thanks, now it has been corrected. One other comment, an error in my ... (by newUser3940)
Problem in Switch-Statement.
 
I am facing a little problem in switch-statement, as we can use integer in our switch statement than why second program is not working. First Program:- ...
[4 replies] Last: Thanks #TarikNaej and #dhayden (by ZahoorKhan)
How do I let variables change based upon a string entry?
 
Hi! I'm setting up a fight system for my text adventure/rpg, and I got random rolls to meet different enemies working. But I'm stuck trying to find out how to c...
[7 replies] Last: Would be cool to see next projects like this from you! And keep learni... (by etrusks)
Visitors - are they even useful?
 
Hi, I just read about "visitors" in Stroustrups book in context of polymorphism. Fo example class Visitor; class Shape{ public: virtual void accep...
[14 replies] Last: n other words, try to push the interface functions as high up the tre... (by cire)
conversion code error
 
Hello, First option km -> m option works but the second option m-> km doesn't work. Please help me figure out why it is not working. //m-km converter ...
[2 replies] Last: Ah okay. I understand. Thank you very much for your advice. (by verzhen1)
What if * and ++ are applied on a pointer at the same time?
 
I cannot explain the output of the program. ++ has an higher precedence than *, but how can you explain the following output, especially the last two lines: ...
[4 replies] Last: #include <iostream> struct pointer { pointer( int* p ) : ptr(p) ... (by JLBorges)
reading strings and ignoring symbols
 
I am trying to do this: a user would input: SEND + MORE = MONEY I want to read the three words without the '+' and '=' and put them into string1, string2, st...
[5 replies] Last: isalpha is a function returns true if the character is alphabetic (a, ... (by PSYCHAMERON)
wrong input handling
 
Hi can you help me with my code. What I want to happen is it loops when it enters an invalid input, so far so good except when I enter something like "4a" it ac...
[2 replies] Last: #include <iostream> using std::cout; using std::cin; int main() { ... (by integralfx)
prime number
 
I was trying to do prime number detector but when I entered "2" it didn't give me a outprint. And when I entered multiples of prime numbers (25, 9..), it print...
[3 replies] Last: Oh yeah, because it's an if else statement, so the for loop never exec... (by pnoid)
OffsetOf getting wrong value
 
struct SSomeData { char mcChar; double mdDouble; bool mbBool; }; int main() { using namespace std; cout << "Offset of mbBool = " <<...
[1 reply] : OffsetOf getting wrong value Any time you find yourself saying somet... (by cire)
c++ * / decimal issues
 
Pretty much all i need to know is how and why when i do my calculation for monthly interest it does not use decimals to a high value such as 10. I have tried u...
[2 replies] Last: Thanks a lot! I thought what i was doing was taking X and then stating... (by vyneroon)
February 2016 Pages: 1... 3738394041... 46
  Archived months: [jan2016] [mar2016]

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