General C++ Programming - January 2015 (Page 11)

Preventing memory leaks
 
I have code that uses a vector, multimap,iterators and a struct. In freeing up my memory I have used the delete() for iterators and maps. Is that the proper way...
[7 replies] Last: ok got it, Thanks again! (by retroCheck)
(almost solved) Constructors/Destructors Student enroling Program (1,2)
 
Hi, I've nearly finished the program but there are some errors saying there are missing semi colons. However when I put them in I get so many errors :( Here is...
[23 replies] Last: The content of course::getEnrollYN() is wrong. Remember that a = 0... (by coder777)
transfer info from one file to another
 
I need to transfer the content from the file text.txt to file sort.txt . The data in the text.txt is "struct" (info about people)but the same data needs to be ...
[9 replies] Last: Ah, it is just a common for loop with slightly different C++11 syntax.... (by MiiNiPaa)
by Kubani
Problem with Sleep() when drawing an analog clock
 
Hi, The question says: Make an "analog clock" that is, a clock with hands that move. You get the time of day from the operating system through a library cal...
[5 replies] Last: I don't understand what you mean! (by Kubani)
need help with array
 
like i enter a number of values in an array of power 10 and i want to see what value i entered in any place in a different window(like for library management sy...
[no replies]
Dumbass calculator using pointer doesn't work
 
I am making a calculator where I will input 5 array of numbers and calculate those numbers with pointers or whatever you call it. I am getting an error like ...
[7 replies] Last: Is this a homework assignment? If so, then please re-read the assignme... (by dhayden)
by Nezar
Effective C++
 
Scott meyers's Effective C++ 3rd edition, Item 25 : Consider support for a non-throwing swap. There's a piece of code with which the author is trying to expl...
[3 replies] Last: Objects of the same class can access each others private data, conside... (by tipaye)
by Irhcsa
Can someone simpilfy this
 
My friend and I are learning c++ and SFML together to create a game. We created something interesting and are wondering if there is a way to simplify what we...
[1 reply] : It's not really complex enough to start worrying about cleaning up the... (by Lachlan Easton)
The resistor program problem
 
I have a lab that is do tonight and I am down to the last error and I am stuck, so any help would be awesome! I am using Visual Basic 2010 and the error is: 1>...
[3 replies] Last: Reading the ResistorClass code, it seems that tolerance is the toleran... (by dhayden)
Arrays/Pointers/Functions
 
I would like to pass the first array into both of the functions. Each function sorts the array. One uses bubble sort, and the other uses selection sort. However...
[1 reply] : int tmp_values ; memcpy(tmp_values, values_case1, SIZE * sizeof(int)... (by Konstantin2)
by yangxh
Why would I encounter "Undefined symbols" after using friend function?
 
I'm trying to implement a string class, most features worked fine until I changed the operator+ from a member function to a friend function(in order to support ...
[3 replies] Last: Thank you guys, I know the reason now (by yangxh)
Part 1 of Template Data-structure Tutorial (Part2 Available)
 
Hey guys, Made a tutorial detailing template data structures aimed at intermediate programmers. Part 1 explains template classes, set up and adding and removi...
[5 replies] Last: Hmm that does sound interesting yet quite complex! I'm a game programm... (by NickCullen)
by tmason
LINUX/UNIX c++ equivalent of chdir()?
 
Hello, When programming under Windows VC++ gives you this nifty command to change the working directory of the application (assuming you include direct.h) ...
[1 reply] : So I answered my own questions: The chdir question: http://linux.die.... (by tmason)
Detecting errors at run time
 
Hello, I'm studying C++ by two months using the book : programming principles and practice using C++, I'm on chapter 5 now studying error reporting. The author ...
[no replies]
by fafner
No viable overloaded '='
 
I'm writing a small linear algebra library to use with some OpenGL stuff. In my Matrix class I have the following two operators defined: Matrix4 Matrix4::ope...
[3 replies] Last: OK, thanks :) (by fafner)
multi level grep expression
 
I am having trouble trying to find an expression that will match a word that starts with "b" ends with "t" and contains "o". The following expression grabs some...
[no replies]
multimap alphabetically ordering with char*
 
I understand multimaps are key ordered. I have no problems with ints but when I put my char arrays in they are not alphabetically ordered. I must use char array...
[2 replies] Last: Got it. Did as you said and everything working. Thanks. (by retroCheck)
by Aenn
Very annoying "can not build" errors plus one other error.
 
First off I should probably say the I use Code::Blocks as my IDE and compiler. When I run the following programs I get a message saying "this file has not been...
[3 replies] Last: This code here seems to work fine: http://cpp.sh/23sz http://cpp.sh/3p... (by kevinkjt2000)
by Kubani
Problem when using a protected function
 
Hi all, Please have a look at Graph.h file of here: http://www.stroustrup.com/Programming/Graphics/ There, both the void add(Point p) and void set_po...
[6 replies] Last: Thank you very much :) (by Kubani)
rand() not working properly?
 
I'm trying to get a board game randomly initialized with either "X" or "O". For some reason it seems that my algorithm is causing all "X" to appear on the board...
[1 reply] : I recommend you turn up the warning level on your compiler. When I com... (by Peter87)
January 2015 Pages: 1... 910111213... 24
  Archived months: [dec2014] [feb2015]

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