General C++ Programming - November 2015 (Page 5)

Question about pointers (and iterators)
 
Can someone explain or provide a link (I couldn't find anything when I did a search), for the reasoning behind using... (*it)->f() rather than... *it->...
[1 reply] : (*it) is dereferencing the iterator so that you get the element that t... (by Peter87)
Need to Debug this Program
 
This is a simple program about managing a class's performance report.It uses the concept of file handling and stored the data in binary format in the data file ...
[1 reply] : On line 138/156: You do not check whether the read operation was succe... (by coder777)
by css416
Recursion Explanation
 
Can anyone help me understand this code especially in the " if (num1%num2==0) " part. I'm just wondering how come it outputs num2 even though num1%num2 is NOT ...
[1 reply] : It outputs the divider of 12. The result of the modulo operator % is i... (by coder777)
by kdrohr
Applying overtime in a calcPay program
 
I set up my program to run based off the employee putting in what the time worked for each week for 5 weeks but I'm having trouble figuring out how to calculate...
[2 replies] Last: After spending a few hours on this. I thought I figured out how to inc... (by kdrohr)
I'm making C++ tutorials. Care for some input?
 
I'm doing this for fun. However, it would be really nice to know whether or not these tutorials have the potential to really take off. I'm just looking for over...
[2 replies] Last: Hi all, I'm new to C++. As experienced VB6.0 programer, I got my sn... (by swdld)
I want to Shorten the algorithm of "check()" function in this program.
 
I want to Shorten the algorithm of "check()" function in this program. void check() { /*for(int i=0;i<3;++i) { for(int j=0;j<3;++j) { if((game ...
[3 replies] Last: Mr.cire I Cant understand your code beacuse I am just a Beginner, and ... (by faique66)
by Ozzy69
Help me with list
 
Hi, i want find this position of elemento 69 in list that is 4. This my code: #include <iostream> #include <list> using namespace std; int main()...
[1 reply] : Add a break: for(it = sexo.begin(); it != sexo.end(); it++){ ... (by coder777)
matching string with arrays
 
how would I match a getline() string with alphabet characters in an array
[1 reply] : You can compare a string with an array of chars with the equal to oper... (by Mr Impact)
Issue with passing info
 
So this all works except the display_board() function. It sends back an error that "board" is not initialized in the display_board() function, so it's not gett...
[3 replies] Last: Well then instead of creating a global variable fill the prototype lik... (by Mr Impact)
1D Arrays and 2D Arrays (1,2)
 
I am a beginning computer science major and coming up on my final lab exam which is unknown exactly what it will be covering. I know that I really do not unders...
[24 replies] Last: Cheers :) (by closed account 48T7M4Gy)
Linked list cannot access last position
 
template <typename T> class node { public: T nodeValue; node<T> *next; node() : next(NULL) {} node(const T& item, node<T> *nextNode = NULL...
[no replies]
char * returns garbage when called
 
Hey there. I am not sure if can exactly explain my issue but I'll do my best. Feel free to ask me stuff if you don't understand exactly what I'm saying (typing)...
[7 replies] Last: TC is using a C-style string; that is, a pointer to an array of charac... (by Zhuge)
how to create a pacman game using c++ ..
 
can any body help me ? how to make pacman game using c++ ..... simple way ...
[8 replies] Last: thank you all i will try .. (by shondhee)
Class help and set, get, retrieve
 
I am running into a little bit if trouble with my homework (not asking for a solution, just a push in the right direction). Our directions are partly as foll...
[3 replies] Last: You are very welcome. (by Thomas1965)
Passing Data Over Network (Serialize ?)
 
Hello, I'm currently developing a server which must transfer much data in a short amount of time. This kind of data is mainly some command such as 'CMD*PARAM...
[9 replies] Last: Then the fastest way to encode that information is in a binary stream.... (by helios)
Please enter to see my problem
 
I need help in the development and modification of the code of the game؟؟ #include <iostream> #include <stdio.h> #include <string.h> #include <c...
[4 replies] Last: I want, for example, the introduction of a second ball moving horizont... (by adel eshtaya)
Function to return the number of parent nodes in a binary tree
 
I am writing a program for my class and I can not seem to get this last function to work. I have to return the number of parent nodes in the binary tree. Here i...
[2 replies] Last: Does "parent nodes" mean non-leaf nodes? (by cire)
Arrays:adding and averaging(text file input)
 
Hello, everyone I am making a program that reads the data from a text file in the format of a single line. The program will count the number of entries on the l...
[3 replies] Last: tree.txt input: 6.5 7.8 -1.4 9 22 -2.7 0 17 Is this the entire input... (by doug4)
DeleteTail function in Linked List
 
How do I implement the "deletetail" function and the "get length" function? Thanks. #include <iostream> using namespace std; class Node { public: int valu...
[1 reply] : #include <iostream> struct Node { int value; Node* next; /*exp... (by JLBorges)
c++ file handling program errors
 
Here's the program Its a simple program that asks for a name and saves it in a dat file and can display it. <code> #include<iostream> #include<fstream> #in...
[6 replies] Last: Well guess i figured out the proper code by my self. Here it is #incl... (by sohamb98)
November 2015 Pages: 1... 34567... 26
  Archived months: [oct2015] [dec2015]

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