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

by mzzz
how to design a smart pointer class
 
smart pointer class is the one that take in charge of release allocated resource when itself destroyed. recently,i want design a smart pointer class, it tak...
[6 replies] Last: You cannot check if pointer points to array or single value that way. ... (by MiiNiPaa)
Getting error in ofstream file.
 
I am writing an eVoting program the addTally function adds 1 to the Candidate's voting tally when called and prints it back to the file from where it took the i...
[5 replies] Last: I've not tried to compile it, but your code should look something like... (by kbw)
I feel like I've gotten the hang of C, stdio.h, and stdlib.h; how do I go about programming 3d graphics?
 
I feel I pretty much know how to use all the keywords and features in C as well as the functions provided by both the stdio.h and stdlib.h libraries. This inclu...
[2 replies] Last: Hi Disch, Thanks for the quick reply, I've been reading the online bo... (by comradejonathan)
by nik65
trouble with webscraping and arrays
 
I am trying to complete a function that takes info from a string, that has been taken from a web page(this part is completed), and then puts the strings into mu...
[no replies]
Approximating 'e' Using a Loop -- Euler's Number Problem
 
I am supposed to have a loop that terminates when the difference between two successive values of 'e' differ by less than 0.0000001 (6 zeroes). So far I have w...
[15 replies] Last: Valid observation. I didn't see that formula from the OP, so you might... (by Duthomhas)
Knapsack Conceptual Doubt - Dynamic Programming
 
I'm trying to learn and implement the solution to 0/1 Knapsack Problem and I checked some videos and websites and I'm somewhat confused. http://www.nitjsr.ac...
[no replies]
Operator Overloading Methods
 
How the operator over Loading methods are called in c++? explain with copy assignment operator and addition operator.
[no replies]
Abstract "static" class and performance.
 
Hi, I have the following code: class Element { public: .. virtual unsigned NumberOfNodes() = 0; .. }; class Triangle : public Element { pub...
[1 reply] : I have one instance of an element, e.g., Triangle for each mesh Share... (by MiiNiPaa)
Convert string IP to unsigned int
 
I need to convert a string IP to an unsigned int (uint32), but however solutions I've found elsewhere have not worked (such as `atoi`). When using `(uint32)"...
[1 reply] : I ended up using `inet_addr("54.171.82.217")` instead. Bear in mind th... (by cybermonkeyso)
if statement to read number negative or positive not working
 
So I tried creating a test code for reading a negative number and positive number but whenever I enter a negative number it read it as being positive. #in...
[2 replies] Last: the value -1 is type of int, so when you compare un1 <= -1, at this m... (by mzzz)
by Glaven
Divide User Input by 2 Until 1
 
Hii,, I need to make a program that takes in a user’s number and keep dividing it by 2 until it is 1.I need to display the division steps i'm kinda new...
[7 replies] Last: at line 15 break; will be unconditionally executed, that will result ... (by mzzz)
Please help
 
My project required four pattern i. a square with a left to right diagonal in which the diagonal is the size of the square ii. a square with a right to left d...
[6 replies] Last: Yeah. Goto function is good at some point. :) But I suggest using "\t... (by jemeripol)
getting problems by using vector in c++
 
hello guys, right now i get some problem in the vector. when i write the code below and run it, i can not get what i need. the problem: 1)when i call the funct...
[1 reply] : branch (input> 100) has no exit to prevent it from calling grades.... (by YokoTsuno)
Determine integer in .txt file
 
I am making an eVoting program which takes input from .txt file and outputs in the same .txt file. I need to ask the user to enter the candidate they wish to vo...
[2 replies] Last: Thank you so much for your help. (by fbhkhan)
Self copying file Challenge
 
Hey, I want to make a self copying file that copies itself into any outside drive inserted into the computer. I am using windows. Anyone up for the challenge? c...
[4 replies] Last: I want a file that can copy itself ad other files onto my flashdrive b... (by jasonwynn10)
Weird includes
 
So, I'm using Visual Studio and I'm coding a Tetris game with SFML. Everything's going well, but I've run into a bit of weirdness. If I #include <iostream> in m...
[3 replies] Last: #include is a preprocessor statement. Before the compiler even gets ... (by LB)
8-queen problem
 
I am trying to program the 8 queen problem. My algorithm checks row by row by inserting a queen in the next column. If it doesn't work, then it goes back to the...
[no replies]
Compiles but refuses to print out char Grades ???
 
#include <fstream> #include <ostream> #include <iostream> #include <iomanip> using namespace std; const int NAMESIZE = 15; const int MAXRECORDS = 5...
[2 replies] Last: TEXT FILE: Dean DeFino 88 98 99 Sally Johnson 78 89 82 Bil... (by hoofhamples)
My file isn't reading
 
The program is supposed to read my file but for some reason it isn't working. The file is .rtf but .txt has the same effects. I checked to see if the file wasn'...
[2 replies] Last: Sorry The file is to print the car number (numbers in the middle) and... (by ProgrammerSoul)
solving maze
 
I am try to generate a solution to a maze using a linked list implementation of a stack in some way. The maze is read in from a .txt file and consists of ...
[6 replies] Last: that is an output tag not a code tag... code tags are in color. (by jasonwynn10)
November 2014 Pages: 1... 1920212223... 32
  Archived months: [oct2014] [dec2014]

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