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

by Yany
How to send data to a POS Printer via USB
 
I need to send a string or char to a "POS Receipt Printer" via USB. My problem is how to establish a communication with the printer by USB port in C++ (I'm...
[2 replies] Last: Thank you Thomas. It worked! This link was the key! The whole day prow... (by Yany)
by JMerit
Help with ShellExecute to open program
 
Hi all. Fairly new to C++ first off. So I wrote a program that has a main menu with several calculators to choose from and after the user has input the data a...
[6 replies] Last: Is there a way to assign the file path from the code you posted to a... (by Thomas1965)
by cppppc
SFML issues??
 
#include<iostream> #include <SFML/Graphics.hpp> using namespace std; int main() { // Make a window that is 800 by 200 pixels // And has the tit...
[7 replies] Last: Thanks a lot to all! (by cppppc)
question about class and mutators
 
Are you able to write a function that calls all mutators in a class. so say I write a function called input that passes a number in. then inside the function it...
[1 reply] : You could but it'd just be the overloaded ctor in disguise: #include... (by gunnerfunner)
by Josd32
Changing The Color Of A Bouncing Ball
 
I'm Just trying to make it so that when the ball bounces off the walls it will change colors based on random(more or less) numbers. This is the code I have so f...
[1 reply] : SetBkColor does not work like this. This function fills the gaps bet... (by Thomas1965)
Strange output format error
 
This is pretty straight forward... My output code: //test_set is a string containing everything after "failed: " to the first "-" //expected is a boolean va...
[5 replies] Last: Ok - in effect the tab character was part of the program input - in t... (by Chervil)
C++ Writing Binary Dump and Writing to Binary from Dump
 
I am stumped and need some assistance. In one of my programs, I am implementing some code so that I can take a program on Windows and essentially do a hexdump (...
[3 replies] Last: A solution has been implemented and I am posting if anyone needs the h... (by spark1313)
Element Searching Easiest
 
#include<iostream.h> #include<conio.h> void main() { int n,h ,s,i; cout<<"Enter Number of Elements"; cin>>n; for(...
[1 reply] : cout<<"Element Not Found!!!!!"; is in the wrong place - it should be... (by Chervil)
How to access map key and mapped types
 
Lets say, for example, I want to make a "get()" function for a map outside of the map class (for some reason). The implementation says that std::map has members...
[3 replies] Last: Well that was pretty dumb of me. Also... aren't you simply re-impleme... (by TinyTertle)
Mean and Standard Deviation
 
Recently i'm working on Mean and standard Deviation program, my question is how can i move the for loop of the mean into the mean function, and for loop of the ...
[5 replies] Last: Your function declaration/prototype parameters don't match your functi... (by integralfx)
by user42
c++ program need help strings (1,2)
 
hi i am a beginner and we just started learning about strings. i am supposed to write a program that creates two strings of size 100 and then the first part of ...
[20 replies] Last: Because when you input something (I have a feeling it's only in char a... (by Troaat)
Keyboard input simulator
 
Hi! I am having trouble finding information on how to create "simulations" of keyboard inputs. For example, I'm trying to automate a game by making the characte...
[1 reply] : On Linux and maybe Apple stuff, look into xdotool . On Windows, loo... (by mbozzi)
Chapter 4 Exercise 4 in PPP 2 Number-Guessing Game
 
I tried to do it using binary search, but I don't know how to get it to continue asking questions to guess the number. And the exercise asked to use the if-els...
[4 replies] Last: Your 'middle' variable never goes above 51, and the program guesses th... (by mrgh05t)
by VTBear
C++ Assign Seating Chart Array
 
Hello Everyone, Looking for some assistance with my code. I was able to get the initial code to allow a user option to enter data and display the .dat file in ...
[3 replies] Last: Your code seems to be working pretty well, though it could be tidied u... (by Chervil)
by VTBear
C++ book assignment
 
So This is what I have so far, and it compiles and runs, but it messes up after the second isbn under "Fuzzy Discrete Structures". Please reply with code struct...
[1 reply] : Your input file format is not accurate - there is a stray 5 on the fir... (by gunnerfunner)
Template Code Instantiation
 
Hi , I have a below Template based code in List.h file : I have pasted the important template call code calls . This template code has implicit template In...
[4 replies] Last: Thanks a lot , commenting the code block in List.c file in Linux pla... (by akshayhigh)
Files , not compiling , any suggestions ?
 
#include <iostream> #include <string> #include <fstream> using namespace std; struct Record { string name; int age; }; string getFileName() { //make...
[2 replies] Last: // Error! You can't return `count` from a function that returns nothi... (by mbozzi)
How to determine if 2 points in 2D space make right triangle?
 
So I'm making calculateDistance function and I don't know how to determine if two points of an object make an right triangle. Here is my code: float ObjectMan...
[3 replies] Last: Assuming the third point is the origin -- take the inner product of th... (by mbozzi)
\n attached to final string in delimited getline?
 
Hi, Trying to read in from a file, using delimited getline. Using the following: string item; int numbers ; vector<Data> MainVec; Draw draw1;...
[9 replies] Last: Ah-hah! A simple, stupid mistake on my part! Many thanks! Currently ... (by Thunderchook)
Recommend a text book on Templates
 
I'm looking for a recommendation for a good text book or online class that can teach me the power of using templates. I've been programming c++ for 2 years and ...
[1 reply] : Classic (2002): 'C++ Templates: The Complete Guide' by Josuttis and Va... (by JLBorges)
January 2017 Pages: 1... 45678... 13
  Archived months: [dec2016] [feb2017]

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