Beginners - September 2013 (Page 31)

by Prim3
Loading text file into a dynamic array
 
Hey guys, new here and I am doing an assignment (yes homework) but I'm kind of stuck.. Pretty much, we have to calculate statistics such as size, sum, median, ...
[16 replies] Last: Of course you must follow your assignment guidelines. I just don't kno... (by closed account D80DSL3A)
Loop and fstream: Removing the user from the equation.
 
I have an exercise for class which I pasted below. I created a loop that works fine. It ask the user to input the number of employees, I do not feel comfortable...
[no replies]
getline not returning all of my data
 
Im using getline into a string and pushing back into a vector. The output is missing the first two characters though. How do you get it to display all of the...
[3 replies] Last: The problem you're encountering is probably due to a newline left in t... (by cire)
by S G H
Ifstream?
 
Time to post in the Beginners section. So embarassing. Now, now. Until now i've been doing file handling with C streams and separating whitespace with my b...
[3 replies] Last: I like the std::string::replace idea. Will edit the loop for my need... (by S G H)
Stuck in a While loop despite it being changed to false?
 
Just to make sure I understand how it's supposed to be working.. The "while" I made starts if and only if the bool StatsDone equals false. And it does, since ...
[3 replies] Last: Oh! Of course. Thanks for helping this newbie out. Might have been som... (by Ganleyd20)
Building a Triangle to tesselate
 
I have gotten two lines drawn but I am having trouble with the last one. I am pretty sure I need to use a Math function in the third line. I am trying to get it...
[no replies]
stuck on a problem..
 
Here is the code I have so far. data file TFFTFFTTTTFFTFTFTFTT ABC54301 TFTFTFTT TFTFTFFTTFT ABC64301 TFTFTFTT TFTFTFFTTFT ABC74301 TFTFT FTFFFTTTFTF...
[5 replies] Last: Line 6. C++ supports const global variables. Safer than preprocesso... (by keskiverto)
Calling A Function From Another Function
 
Simple question I know you avid programmers can answer. :) Let's say I have a function called "distance" that computes the distance between two points. What...
[4 replies] Last: Sorry that I struck a nerve, Matri X. I don't really know what makes y... (by xismn)
Babylon challenge
 
Can you guys help me with this problem. I have no idea how to even start it. The Babylonian method to calculate the square root of a positive number n is as...
[1 reply] : I actually made a post of this the other day http://www.cplusplus.com... (by giblit)
Simple Deriviation Program
 
I'm a beginner in C++. In this program, I'm attempting to derive a simple mathematical problem (i.e. 3x^8 = 24x^7). I know where my problem is, but I don't know...
[5 replies] Last: Actually, it's a lot simpler than I thought. Thank you for your input ... (by andrey 117)
by aggsyb
Creating a string from a vector string..
 
Ok so I have a vector called listOfFiles that contains plenty of file names as strings. I randomly grab one of them with using a random number generator listOf...
[4 replies] Last: Thanks for the replies! I had a taxi waiting for me outside midway thr... (by aggsyb)
Wait for and read keycode
 
I need to be able to wait for an input from the keyboard, and get the keycode of the key that was pressed (0x30 Etc. Not char). I've been using _kbhit() to w...
[no replies]
printing after each pass, sorting
 
Okay, so my program works fine, but I am trying to add something in here and I just don't know how to add it in. For each sort, I need the program to print o...
[no replies]
Linker error, passing an array
 
Hi, I am receiving a linker error when trying to run the program. It has to do with the array I am trying to pass from main into my search function. I know it...
[4 replies] Last: Yeah, thanks guys...I was able to get it to work. It was just one of ... (by MrBrewski99)
by Nebur
Check wether a number is palindromic!
 
Hi everybody! I am working on a program, that tells wether a number is palindromic, and in my opinion, the code i have pasted works perfectly for such purpose....
[6 replies] Last: On the subject of iterators, I will also add using string iterators. W... (by Smac89)
Count words greater than 6 letters.
 
Hi! I am new to C++, and got this assignment in school. I need to create program which is able to read from a textfile and A: Count the sentences B: C...
[1 reply] : You'll need some extra int s:   Bogstaver_ord      to track ... (by Duthomhas)
by clguy
No output after "while" loop. WHATS WRONG?!?!
 
Hello, I am a newbie getting into programming and I am having an issue to get my "cout" to show after doing a while loop. I am not sure what I am doing wrong, I...
[5 replies] Last: Ok, yea I did set (Balance > 0) before checking again and it did bette... (by clguy)
help required friends (1,2)
 
#include <iostream> #include <conio.h> using namespace std; int main() { int n,smallest; cout << "Enter A Number :" << endl; cin >> n; if (n >= 0) smal...
[21 replies] Last: thanksssssssssssssssssss.........great person (by awais rana)
by Olpers
Pointers
 
Need to understand this part of code: int main() { int firstvalue= 5, secondvalue= 15; int * p1, * p2; p1 = &firstvalue; p2 = &secondvalue; *...
[5 replies] Last: Olpers you are having a hard time understanding that you are no longer... (by giblit)
assignment question
 
#include <iostream> #include <conio.h> using namespace std; int main() { int n,smallest,smallest2; cout << "Enter A Number :" << endl; cin >> n; smalles...
[2 replies] Last: http://www.cplusplus.com/articles/z13hAqkS/ (by SamuelAdams)
September 2013 Pages: 1... 2930313233... 64
  Archived months: [aug2013] [oct2013]

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