General C++ Programming - March 2017 (Page 8)

Reading file line by line into string
 
Hi, so I'm trying to open a file and read the sentences in it line by line and put them into string and then put that string into a function. So far I have thi...
[5 replies] Last: Even if you are "restricted to basics" you can take inspiration from l... (by cire)
Reading a file and printing it
 
I have this program. It's supposed to read from a .txt file like: The problem is, this prints on the console. How do I print this out a .txt file like output...
[1 reply] : > How do I print this out a .txt file like output.txt? In exportTab... (by JLBorges)
by Murozo
C++ Windows 1998 Start Home Animation
 
https://www.youtube.com/watch?v=9QVnL50gDg4
[no replies]
by Murozo
C++ Google Animation
 
https://www.youtube.com/watch?v=qh2qVPxWZLM&t=359s
[no replies]
by Murozo
C++ Minecraft Herobrine Animation
 
https://www.youtube.com/watch?v=y-sj_k-9izw
[no replies]
console game to windowed game
 
I've been working on a small console game for a while now but I'm running into the limitations of the console such as "rendering" is slow it has to type all the...
[7 replies] Last: lol I've played Dwarf Fortress once. I wonder how they made their grap... (by dudeawsomeness1)
should i use a recursive function or a "for" loop to calculate the factorial of a number?
 
so i have two pieces of code,both perform the same task "which is to calculate the factorial of a specific number",but the first one does this using a recursive...
[2 replies] Last: neither. use a lookup table of about 25-30 values, unless you are pul... (by jonnin)
Please help with multiarray
 
#include <iostream> #include <iomanip> using namespace std; void Monkeyloop(); const int Monkeys = 3; const int Days = 5; double MonkeyData ; int main() { M...
[1 reply] : bump (by needhelpplease11)
by jafa
How do I validate letter grade is valid?
 
Hello, Part of my assignment is to validate that the entered grade is either A, B, C, D or F. What am I doing wrong? Here is the what I am trying but it does...
[2 replies] Last: Thanks JLBorges so much!!! (by jafa)
Quadratic Equation Code
 
I'm trying to create a code which will solve a quadratic equation ax^2+bx+c=0 where the user inputs the a, b, and c and the output is the roots p and q respecti...
[3 replies] Last: basically,you don't need a class to do this. as jonnin said,you can de... (by Syrian Lucianos)
String & File input
 
So i'm new to C++ programming, and have a project in where the user inputs a sentence, and based on 5 grammar rules (Ex. <sentence> ::= <noun><verb><noun>), det...
[11 replies] Last: #include <iostream> #include <string> #include <fstream> #include <ss... (by fireblz5)
Storing information from a txt file
 
So I am supposed to make a mad lib game that randomly fills the empty spaces with the type of word that is required there. I have a txt file that contains pre d...
[no replies]
Recording the frequency from an ngram
 
I am tasked with recording the frequency of the ngrams in the argument map<string,long> reference. Below is what I have so far, just to note that clean_string j...
[1 reply] : Stop ignoring the return value for generate_ngrams and see http://en... (by cire)
<< operator error syntax near cin "endl"
 
#include<iostream> #include <string> #include<iomanip> using namespace std; int main() { //setting up numeral input double loan_Payment; double in...
[1 reply] : Cin loads data into variables, endl is used when you want to print a n... (by TheHardew)
PPP2 Chapter 12 12.7 Images
 
I'm trying out the GUI code in Chapter 12 Section 12.7 and I was wondering if there was a way to get the images he's using in the code. Also, while I'm able...
[no replies]
Storing creatures in a fighting simulator?
 
Hi! I'd like to make a pokemon fighting simulator, where you have an image and every pixel is one pokemon. Every pokemon has it's speed, x and y positions...
[no replies]
Map to String
 
So I am given the function where I am given a map that has a string key and a long value, and it is a pointer of m. I know how to print a map, but I am not sure...
[2 replies] Last: Thank you! That helped me and I was able to come up with this to get t... (by PirateCat)
Can you complete this 'class" example
 
Hi all! I found in my book a "class" example, not complete, that I am unable to complete since I know almost nothing about chessboard. This example seems to me ...
[2 replies] Last: Thank you, Cubbi, for your reply. There must be hundreds of creators o... (by sylvain)
Help me find my mistakes PLEASE!
 
Hi guys! Really need some help with my school project! I needed to create a program to compute federal personal income taxes. Requirements that I am to follo...
[2 replies] Last: #include <iostream> #include <iomanip> using namespace std; int mai... (by closed account 48T7M4Gy)
not initialized
 
As seen in the image below I am initialising a variable for a class http://puu.sh/uOv5E/7f5ce0e517.PNG Yet when I run my program visual studio tells me I ha...
[5 replies] Last: Sorry gunnerfunner :( (by RvBVakama)
March 2017 Pages: 1... 678910... 19
  Archived months: [feb2017] [apr2017]

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