General C++ Programming - November 2014 (Page 15)

String question
 
Hi! Im trying to make a c++ program for a school project, and i need to store the information into binary files, but I'm having some problems trying to store a ...
[4 replies] Last: A unique terminator doesn't help when using the read() Who forces you... (by MiiNiPaa)
Help With Leap year program
 
/***************************************************** M 6.3 LeapYear.cpp T *****************************************************/ /* The program Leap...
[15 replies] Last: #include <iostream> using namespace std; int main () { int year; c... (by anup30)
C++ programming Craps game simulation
 
Write a C++ program that simulates the casino game of craps. These are the rules of the game: • If a player throws a 7 or 11 (sum of two dice) on the first r...
[1 reply] : You should format code with the code format tags. As you haven't node... (by kbw)
What should a packet look like?
 
Hi. A more general question about network programming. I'm trying to create a server/client messenger system just as a learning project and so, I'm wondering ...
[2 replies] Last: I'm trying to create a server/client messenger system just as a learn... (by kbw)
by wuubb
initializing multidimensional string array
 
G'day all, In one of my programs I have a 3x3 array of string that I use to display the outcome to rock, paper, scissors, and another 1x3 used for a number g...
[4 replies] Last: didn't realize that arrays worked differently than the other variable... (by MiiNiPaa)
How do I return element in an array thats inside a class?
 
I have a program where I roll a die X number of times and need to print how many times it lands on each side. I tried to create an array in the class aDie that ...
[3 replies] Last: aDie::aDie() { int countOfRoll = {0}; //this is a local variable,... (by ne555)
Why isn't this program working?
 
I am trying to allocate a node variable on the heap using "new". Im trying to do this in the function enqueue. The error highlights "node* node=new node;" and s...
[2 replies] Last: @Jib, thank you it worked. (by armonsafai)
generate random type
 
Hi, Is there any way to generate random types I build? I know rand command returns random integers, but I want to create some classes and and a function th...
[1 reply] : Try making a template and then, make a random number from the random n... (by rjvc)
by cGuru
Connect Computers To Play Game?
 
I have a Blackjack game that allows users to create a login account and it keeps track of their bet amount, and total bank,etc. How can I connect the program o...
[2 replies] Last: (A) How would I code it? Very Carefully (and it would be very sys... (by Cheraphy)
Pig Latin Program
 
A class assignment requires I write a program in C++ that translates phrases into pig latin. It does it a bit differently than most of the pig latin programs I'...
[7 replies] Last: or you could do that... (by jasonwynn10)
Please I need help regarding this c++ peoblem
 
You need to write a code, which will calculates results, depending on the values that user enters to the running software: i.e. 1) Y=1/A i.e Y – is re...
[5 replies] Last: the way this site works is that you have to give us a start that you m... (by jasonwynn10)
What design pattern to handle this?
 
#include <iostream> #include <string> #include <list> #include <vector> #include <set> #include <array> struct Person; struct State {virtual ~State() = defa...
[5 replies] Last: Ok, I've been able to adapt JLBorges' solution to meet my original des... (by prestokeys)
pass fail input
 
i cant seem to get the program to return the right grade it keeps returning 0 or 1. i want the program to return true for grades grades greater then or equal to...
[3 replies] Last: duplicate thread here http://www.cplusplus.com/forum/beginner/147918/ (by wildblue)
Swapping nodes in a doubly linked list - bad logic??
 
I've been working on this linked list priority queue for the better part of two days now, and for the life of me I can't find the root of this seg fault. It's d...
[4 replies] Last: swapUp actually takes it's argument by pointer, so I don't think that... (by cire)
Mixer loop optimization?
 
Anyone knows if these loops can be optimized? #define C_SAMPLEPOS(channel) (channel->sound.position) #define C_BUFFERSIZE(channel) (channel->sound.numsampl...
[1 reply] : I've worked on it a bit: //Simple macros for checking samples! //Pre... (by superfury)
by Ksenon
Caesar's cipher
 
Hello everybody. I've got as homework the coding of Caesar's cipher in C++. I've created the following code. It turns out that the getline function is not worki...
[5 replies] Last: This can be problematic. Those characters are not a part of standard c... (by MiiNiPaa)
help
 
Hello, can anyone help with this program? [The cost of shipping is 3 KD (currency) for the 1st kilo and 1 KD for each additional kilo for the first 49 kilos...
[4 replies] Last: thank you so much (by JojoCx3)
Struct Reference Initialisation
 
Hey there, I have a custom struct hierarchy that goes vaguely like this: struct Base {}; struct Derived1 : public Base { int num; }; struct De...
[1 reply] : struct base { /* ... */ }; struct my_class { // http://en.cppref... (by JLBorges)
Template Capture Stringency
 
Hey there, I was creating a template and I realised that certain data-types/structs/classes would not be applicable to my template. This would cause bugs and ...
[2 replies] Last: Thank you very much. Will read. (by SixTsevN)
Program not giving output.
 
Q. WAP to find the next palindrome number larger than the input number. for eg:- Input=25 Output=33 The program is giving correct output for number ...
[8 replies] Last: #include <iostream> #include <string> static void add(std::string& ... (by iQChange)
November 2014 Pages: 1... 1314151617... 32
  Archived months: [oct2014] [dec2014]

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