Beginners - February 2017 (Page 19)

Incorrect Output
 
I'm trying to find the mean of the vector, and then cout all values below the mean. But it keeps cout as zero. I think it may be because of the -1 to stop th...
[2 replies] Last: jonnin - thank you for your help. I accidently did greater than when I... (by closed account 3vX4LyTq)
Windowed programs
 
I've learned most of what C++ basics has to offer up to polymorphism. How do I continue to windowed programs (specifically making games such as simple platforme...
[2 replies] Last: Thank you so much! That's the fastest I've ever gotten a reply. (by pickaxe9999)
Alignment Issues
 
Hello I am trying to get my end result to be lined up properly, but I'm having a hard time doing and understanding the process. It should look like this as the...
[1 reply] : #include <iostream> //#include <cstdlib> //don't use rand(): http://... (by gunnerfunner)
Program compiles but crashes
 
I'm trying to write a program that, you tell it what you want, and it removes one from the quantity. It's compiling just fine and it even sends back the fail me...
[2 replies] Last: http://www.cplusplus.com/forum/beginner/208390/ http://www.cplusplus.c... (by TheIdeasMan)
inputing strings to vector
 
The program should read an unknown number of names and phone numbers from a file “data.txt” and store them in a vector of strings. The program should then a...
[2 replies] Last: Your variable fileName is already a string You don't need to put it i... (by smartypantzss)
lexicographically compare strings
 
how can i compare each element of string array lexicographically? For example, if i want to find the smallest element in folks = { "samwell", "jon...
[1 reply] : would simply comparing each element like if (folk <folk ) {do somethi... (by mbozzi)
Questions of Class Homework C++ Intro
 
Hi, I'm new here just want to ask a question how to calculate and print number 1/1 + 1/2 + 1/4... + 1/100000000 using float and double variables while using a l...
[15 replies] Last: Thank you for the brief explanation. (by shadder)
Expanding an Array with Pointers then Shifting Elements?
 
Hey guys, I am doing a problem out of a c++ book. No, this isn't homework, I am doing this for myself here at home. Here is the program requirements out of the ...
[1 reply] : 1. The last element of OriginalArray is at index elements - 1, but the... (by helios)
by tit0n
Trying to compute the closest pair. Help?
 
we are given double d = p .distance(p ); Im not sure how to make out this code. Can anyone explain? And how would I go about this?
[12 replies] Last: #include <iostream> #include <vector> #include <fstream> #include <c... (by gunnerfunner)
[Error] id returned Exit Status
 
My code was running smoothly then I changed (4/3) to (4.0/3.0) and now I'm getting an error message. Could someone explain what is causing the error message and...
[3 replies] Last: I had that in the code allready sorry I just realized it wasn't inclu... (by nolman610)
Need help on calling objects and parameter objects
 
So for say I have a function called commonType. In my main.cpp file there is a call and it looks like this: pokemon1.commonType(pokemon2) Now I am confused ...
[2 replies] Last: Oh okay, makes sense now. Thank you for the explanation. It works (by kikiyox77)
integer questions
 
a is an integer and if (a%2) cout << "abc"; does that mean that the program will only print out abc if a is an odd number?
[1 reply] : yes.. (by ar2007)
print prime numbers between any tow number
 
hi you I write program print prime number between any tow numbers using recursion function but I have problem in code please help me #include<iostream> usi...
[6 replies] Last: ok I want to correct code (by mohabd73)
by arbwok
Reading text file as an array
 
Hello I need help reading text file as an array and line by line. Lets say I have a text file [4: 1 2 3 4] [3: 22 77 101] [4: aa ab bb ba] [8: xx yy cc ...
[no replies]
constructore and initialisers
 
I have an employee class that stores various details about, and one of those details involves another class clled date. I want to initialise this class in emplo...
[4 replies] Last: Thanks everyone for your input! After reading and head scratching I ha... (by jamesfarrow)
Multiplication and Addition for Doubly Linked List
 
I am attempting to make infinite arithmetic calculator for multiplication and addition. I tried about everything including divide and conquer for writing the op...
[12 replies] Last: this keeps it around instead of allocating it every time You're righ... (by mbozzi)
by stas76
loop for(int s:v) what does it mean?
 
Hello, I'm reading Stroustrup book PPP using C++ And here I saw such loop for(int s : v){} What does it mean such notation? Thanks
[2 replies] Last: Thanks (by stas76)
txt read block by block
 
Hi guys, i'm having trouble on a little practice exercice i am doing for a exam, and i can find anything about it, we are not using std, i'm trying to read a .t...
[2 replies] Last: Thanks alot mate, that's exactly what i needed, btw i atually used t... (by jacktharippa)
Programme crash
 
Hello guys. Could someone please point to me why this programme crash every time I run it? It crashes after reading and displaying the total number of books so...
[3 replies] Last: I got it. I was looking at it as years is the array counter. I just ... (by Misbahu)
How do I save data to a .txt file
 
so i have data that was printed out in a for loop i want to put all these values into a file
[1 reply] : There's info and code examples of writing values to files in the tutor... (by wildblue)
February 2017 Pages: 1... 1718192021... 37
  Archived months: [jan2017] [mar2017]

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