Beginners - May 2017 (Page 8)

saving to dekstop
 
Windows 10 CodeBlocks How do I save my program to my desktop, so I can open it by just clicking on it rather than going through Codeblocks? My guess is t...
[2 replies] Last: Thank you for this. I tried this with my existing projects and found t... (by volTron)
Re: Function to calculate Tax
 
Hi I am writing a function where is calculates TAX based on AGE and Income. The error I get is below and I have been researching to find an explanation but ...
[8 replies] Last: Thank you very much Enoizat and Jonnin. After those hint and example, ... (by Tavalya)
by Faruk1
Student's T-distribution
 
Hello, I want to write a t-distribution code that will calculate two-tailed one, lower value 0, upper value 1.1 and degrees of freedom 9. Could anyone he...
[5 replies] Last: I should just make sure that you understand the code. If you feel lik... (by lastchance)
by zspar
Doubly Linked List Copy Constructor and Overloading = operator
 
We were given Student class and Student Roll class (header files included below) The only things I cant figure out so far are how to overload the = operator for...
[3 replies] Last: You can explicitly call a destructor, although the uses for it are rel... (by mbozzi)
rand()
 
giving same value every time 41, 18467 and so the values are same #include<iostream> #include<stdlib.h> using namespace std; main() { int z,i; ...
[2 replies] Last: Posting your question twice won't help you. (by Kiryu)
by stav
array incomplete type not allowed ?
 
so this code works fine: private: GLuint vertexBufferID; GLuint elementBufferID; GLfloat verts = { 0.0f, 1.0f, -1.0f,-1.0f, 1.0f,-1....
[1 reply] : ' Flexible array member ' is a C99 feature (thre must be only one such... (by JLBorges)
rand()
 
Please Check And Solve The Problem it Shows Only 41 #include<iostream> #include<stdlib.h> using namespace std; main() { int i; i = rand(); cout<<i; } ...
[1 reply] : rand() generates a fresh value each time it is called. In your case,... (by Chervil)
Difficulty grasping exactly what a defines a function
 
While I can usually manage to complete my coding homework, I have a hard time understanding what parts of my program count as a function and which parts don't. ...
[5 replies] Last: To give another example from some of your own code, http://www.cpluspl... (by Chervil)
by Caruso
Classe Constructor
 
Hi All, When I run this code it prints one X. That is when u is defined as a variable of type Uno. What I'm wondering is why there is no X printed when e is ...
[5 replies] Last: Thank you very much. It is indeed the copy constructor that I was miss... (by Caruso)
'undefined reference' problem
 
Hi, I got the 'undefined reference' problem. So I can't compile my code. Here is my code Stack.cpp [#include "Stack.h" using namespace std; template<class T...
[1 reply] : for class template compile the header and implementation in the same f... (by gunnerfunner)
by VX0726
Array Duplicate Output Is Repeating
 
As an assignment, we had to input an array of numbers. Then, we had to output the number and the number of times it was repeated. Although my program does so, i...
[1 reply] : Since the final destination of the numbers is std::vector<double> why ... (by gunnerfunner)
by toklo
Recursion Question
 
I've spent hours trying to code this with little progress. Recursion is tough to wrap my head around. Basically I need to output the first six terms of an equat...
[14 replies] Last: Thank you. Figured it out. (by toklo)
Yesterday's time as a string
 
So I was wondering if someone could give me a point in the right direction here. I have a program I'm looking to build that will take a string from a text file ...
[4 replies] Last: Thank you JLBorges, this looks like it's exactly what I'm looking for.... (by Miles Hikari)
Accessing private members
 
I have class class Text{ private: char* text; public: void set(const Text &t); }; When I define this function, void Text:...
[2 replies] Last: I have a private *Text in Menu (by keh k lenge)
how do i access my command line?
 
i opened CMD and i typed something in and nothing happens
[7 replies] Last: probably didn't press <Return> and turned off echo (by ne555)
How do i open a binary file?
 
Write your question here. fstream file("test.bin", ios::binary); if(file.is_open()) { cout << "I am open." << endl; } else { cout << "re...
[3 replies] Last: "text" files are binary files, by the way. The binary functions can ... (by jonnin)
Tic tac toe game.
 
I'm trying to make a simple command-line tic-tac-toe game where you have an option to play against another player or the computer. I attempted to make a functio...
[2 replies] Last: thanks, simplified that! also noticed i was missing curly brackets aft... (by stayinside4ever)
Reading "complex" data from .txt file : revisited (1,2)
 
Hello, I am trying to read from a file made of groups of data separated by (xx xx xx) Sample // in TrainStations.txt MavisBeacon (161 0 23 1)(162 3 ...
[24 replies] Last: SOLVED ifstream readTrain(TRAIN_FILE); if (!readTrain.is_open()) ... (by longberns)
Vector of structure
 
Suppose we have a structure: struct Position { unsigned int i; unsigned int j; }; and we have a vector: vector<Position> cp ; The aim of the program i...
[9 replies] Last: I edited. I do not know how it ( cp.clear(); ) got in to the struct ... (by Vahagn8)
Question on Iterators
 
I understand that the asterisk is a dereferencing operator, however is it required to use when trying to output what is within a vector onto the screen? The top...
[8 replies] Last: Note that a range-for loop is a deliberately simple construct. For ex... (by JLBorges)
May 2017 Pages: 1... 678910... 24
  Archived months: [apr2017] [jun2017]

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