General C++ Programming - January 2017 (Page 12)

by stat1c
output window will not stay open
 
I have an assignment where I need to write a grades calculator for two tests, the tests average for each student, as well as the letter grade. I got the code to...
[3 replies] Last: You need to put this code at the end of main. //Wait for a characte... (by Thomas1965)
smart pointer incomplete type
 
//file: a.h #pragma once #include <iostream> struct A { ~A() { std::cout << "~A" << std::endl; } }; //file: b.h #pragma once #include <...
[1 reply] : The (shared) control block of a std::shared_ptr<> object holds the d... (by JLBorges)
smart pointer incomplete type
 
//file: a.h #pragma once #include <iostream> struct A { ~A() { std::cout << "~A" << std::endl; } }; //file: b.h #pragma once #include <...
[no replies]
by Anon99
Reading from csv file
 
I am trying to read from an excel file, then only print out the unique values. My code, however, prints out all values. This code works when using an istringstr...
[16 replies] Last: #include <iostream> #include <string> #include <cctype> #include <vec... (by JLBorges)
by Anon99
Unique words
 
I am trying to read from and excel file and I have a list of names but I want only to print out the names that are unique. ie if sam appears twice I want to dis...
[8 replies] Last: for (name_iter = nameHolder.begin(); name_iter != nameHolder.end()... (by Anon99)
Index filter
 
int n = {0}; //initializing all my values to zero //setting values of n i'm interested in // This are just example values I actually have a lot of n an...
[18 replies] Last: Marcus,Mbozzi and Keskiverto you guys have been incredibly helpful. Th... (by newuser12)
by burn2y
Printing Arrays
 
Hello all. I need some help with my program I have written below. Excuse any "poor" coding. Just started learning C++. #include <iostream> #include <fstream> #...
[1 reply] : For a beginner your code looks good and works well. To format the outp... (by Thomas1965)
by blanm
Audio Sampling in C++
 
I'm trying to read from a WAVE file for a school assignment. The project is to sample from the file in order to get enough points to perform a DFT and isolate e...
[15 replies] Last: I actually had better luck using ffmpeg :) ffmpeg -re -i assets/440hz... (by mbozzi)
c++ set insert in descending order ?
 
insert in c++ set does its job in ascending order, is there a way to make it work in descending order ?
[2 replies] Last: thank you (by mohamedeltair)
PPP2 Chapter 6 Exercise 3 Help Needed
 
Edit: Never mind. I got it. If the post wouldn't have gotten too big, I would've posted the solution here with the code, but it couldn't be done in this case ...
[no replies]
Best Exception handling practice
 
Today I was starting with SDL, and in their wiki under the SDL_Init() function page there was this example: #include <exception> #include <string> #include "...
[2 replies] Last: Thanks Cubbi :) (by Marcus Aseth)
Random number coin toss
 
I was going through a programming book and there was a question to write a program in which you toss 2 coins 20 times and show the highest number of combination...
[9 replies] Last: well i have exams for two consecutive days so i will be posting the co... (by mabasitbhatti)
Comma Delimited Variable Declarations
 
Hi all, I was working on a project and came across something that doesn't make sense to me. The below code doesn't compile: #ifndef HEAD_H #define HEAD_H te...
[9 replies] Last: That's a good one: struct node { node* x = new node(); }; The s... (by Cubbi)
Please! Calculate direction of a ball shooted
 
Hi, i create games with SDL2 but now it doesn't matter. In my game there is the player and the enemy. Enemy can rotate itself watching to the player and can...
[6 replies] Last: Solved with proportions: a = enemy.x-player.x; b = enemy.y-player.y; v... (by Manuel Di Criscito)
by Inayah
Diabetes Detection Program source code needed
 
I am doing this project for my final year but i cant find a code that runs on visual studio. kindly provide me a code that would run on visual studio 2012. than...
[1 reply] : int main() { return 0; } There you go! (by edge6768)
PPP2 Chapter 6 Section 6.3.1 Expression Calculator
 
In the PPP2 book, there's for an expression calculator that Stroustrup has us make through trial and error and he's using it to teach us program design and how ...
[4 replies] Last: I put in those cin.ignore() calls because it clears out the input buf... (by cire)
Using many functions
 
I'm reading a book in which a window class' constructor doesn't initialize all the implementation directly, instead it calls a function that calls another etc.....
[2 replies] Last: An init() / setup() method is useful in cases where the work that wo... (by mbozzi)
force close all files while code is running
 
hello again, i am a beginner and currently working on parsing pcap files. I have successfully parsed and got data from it. After that i tried to implement it i...
[5 replies] Last: well there isn't any way to close pcap file after reading it. Again,... (by mbozzi)
Print first n Fibonacci Numbers (1,2)
 
I need to write a program that prints the first n Fibonacci numbers (it also has to find the largest Fibonacci number that can fit into an int, but I'll worry a...
[23 replies] Last: Yeah, you're right, there's no difference. I took the test out and it... (by DragonOsman)
Need help!
 
Hello, I am relatively new to the whole C++ thing. However, I have picked up some skills to make a simple text based game. Now I am planning on making an ...
[12 replies] Last: Line 13: input really doesn;t belong as a member of your Data structu... (by AbstractionAnon)
January 2017 Pages: 1... 10111213
  Archived months: [dec2016] [feb2017]

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