General C++ Programming - June 2016

push/pop printing issue
 
Hi, how do I print the value being popped or being pushed just to follow what's going on? I get windows error(below). I can print nStack.top() fine. Just not th...
[7 replies] Last: Look at your error message: In function 'int main()': 23:19: error: i... (by jlb)
Help with finding errors in tic-tac-toe program
 
I am working on trying to teach myself C++ with the book "Beginning c++ through game programing 3rd edition". I am working on the tic-tac-toe program from the ...
[3 replies] Last: UchihaKite Thanks for the help went back and looked where you pointed... (by Rosebudjfg)
Reading a txt file to check if there is word
 
Hello all, Thanks in advance for your help! I am writing a program to read a file and check if there is word in it. A part of the text file looks like this: B...
[3 replies] Last: The program's main purpose is to check whether there is a word in a c... (by Half Life G Man)
by doug4
Creating a Random file of fixed size
 
I am interested in creating a fixed size file (~25M) with random data. I am currently considering copying data from /dev/urandom into my file. I am familiar ...
[13 replies] Last: @doug4 It was just example code, I figured you knew to delete a 25Mb... (by Xerxes004)
Determining if a type has a certain method??
 
Hi, i am writing a template that detects whether a type has a certain method (call it Do). So far I have the following: using bridge_type = void; // ca...
[12 replies] Last: @JLBorges, Yes, I am stupid. I hope that was tongue in cheek. You... (by doug4)
by Medino
Reading a two dimensional array with two wile loops
 
Hi there it seems that these two while loops can't read my 2D array. What's causing it, I know it's my faulty programming but what exactly? #include <iostream...
[6 replies] Last: Ok, thanks again. (by Medino)
Artificial intelligence Tic Tac Toe game with C++
 
Artificial intelligence Tic Tac Toe game with C++ I use only iostream library. I hope that helps. Project and code : Project Page : http://www.ardamavi....
[no replies]
draw and display bitmap
 
I'm reading the coordinates and the color of the pixel from a database file , what I need is an way to make a image with this values , can you suggest something...
[no replies]
Re-initialising srand without exiting
 
Currently creating a basic RPG as a side hobby. I have two classes which will battle and have decided to give them integer values for damage and apply a modifie...
[2 replies] Last: TL;DR: You're wasting time. Just call rand() to get a random numbe... (by Duthomhas)
Help with this equation please ....
 
Please see the link below which has the equation. http://i.imgur.com/2st6U9Zl.png Can anyone help explain this equation to me ? Thanks
[1 reply] : that's quite ugly, ¿can you improve it? Basically you need to sum a ... (by ne555)
by Zapeth
Why is printf not printing this correctly (but cout is)?
 
So here's a short overview of what I want to use -> http://preshing.com/20150324/safe-bitfields-in-cpp/ And here is the definition/implementation of the code t...
[3 replies] Last: But then what is passed to the printf function without the explicit c... (by cire)
by rpsalh
program not running
 
/*Program to count the number of lowercase characters entered*/ #include<iostream> #include<stdlib.h> #include<stdio.h> #include<ctype.h> using namespace ...
[2 replies] Last: Thanks now it is working as it should.Yeah, one more question will it ... (by rpsalh)
C++ programming (1,2)
 
Write a program in C++ to prepare a frequency distribution table of the percentage marks in Computer studies of N students, to be taken as inputs, into the foll...
[33 replies] Last: Well done suresh - at last some success. :) (by closed account 48T7M4Gy)
Programming outside the command prompt
 
Okay, so I've been working on my programming a lot lately and feel like all my work is being wasted on only having my code come only get built and ran in the co...
[2 replies] Last: Wow, I didn't expect anyone to give me so much information! But I alwa... (by YvngSavage)
by rpsalh
cin vs getchar()
 
i was trying to make a program it worked good with cin but not with getchar please tell. /*Program to read a character and display its next character in the A...
[5 replies] Last: thanks got it (by rpsalh)
SFML or Qt
 
hello guys! I have to developer a game with c++ programming language it is a tower defense game what is the best library to develop this game? sfml or qt? ...
[5 replies] Last: Yes, SFML is probably preferable. (by helios)
Operator overloading
 
For a simple struct like struct MyObject { int number1; int number2; } Do I have to implement += operator if I already implemented operator + , i...
[8 replies] Last: Hi Helios, my bad. You are right. It is overloaded by someone else an... (by chrisben)
std::unordered_set speed comparison with vector (1,2)
 
For some reason this container is creating more buckets than elements that are in it :+( #include <iostream> #include <iomanip> #include <vector> #inc...
[20 replies] Last: > Most all the containers have begin iterators (except the Container A... (by JLBorges)
Standard To Military Time
 
I'm pretty sure something is wrong either in my timeOfDay() or convertTime(), because what the heck. #include "stdafx.h" #include <string> #include <io...
[9 replies] Last: Oops - all fixed, thanks w1 (by closed account 48T7M4Gy)
Best option for loading data
 
Hi, I'm looking for a library for loading map and player data for a videogame. I've looked at using the general c++, but I'm wondering if there is a better a...
[1 reply] : Sorry about that, OP. Some disruptive user or users would appear to be... (by helios)
June 2016 Pages: 123... 14
  Archived months: [may2016] [jul2016]

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