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

Arrays Question: Functions not functional
 
First time poster here. Glad to join the forum. I'm currently reading "Jumping into C++". I'm stuck solving this practice problem on arrays: Write a program t...
[3 replies] Last: Thank you doug4 and Disch. I can see the mistake I was making. (by nakane09)
by nik65
stuck on 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]
how is it working?
 
Hi everyone, I was reading a c++ code and I saw this: #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv ) { c...
[no replies]
Storing Life Form Details in a Class
 
So for an assignment, I have to create this Life Form class. The instructions are... (skip the big blob for a summed up version) Create a "Life Form" class tha...
[no replies]
std:out_of_range when using string::erase
 
I was using a small code snippet to erase <em> from string doesn't work? Code: string htmlLine = "<em>suez</em> canal"; string searchEm = "<em>"; int posEm...
[4 replies] Last: Thanks, now it works. And thanks @jib for the tip! (by Just Me)
Returning a dynamic value from a function
 
is this considered a memory leak? Polygon* create_square(const Vector2d& position, const RGB& colour, const std::string name) { // Polygon, Vector2D, RPG a...
[1 reply] : Not if you delete it when you're done with it. Although your 'Polygon'... (by Computergeek01)
class
 
#include<iostream> using namespace std; class a { public: virtual void add(int)=0; virtual void dis()=0; }; class b:public a { int m; public:...
[1 reply] : ...can any one know whats going on? Yes, and although it admittedly ... (by Computergeek01)
inheritance and composition
 
can any one help me In this assignment the student should develop a month calendar by designing a class called calendarType . This class uses two other c...
[1 reply] : Please note, that this is not a homework site. We won't do your homewo... (by keskiverto)
help
 
I got homework to write a program and I'm stuck in all of it lol please if you have the code for this program send it to me .... _________________________...
[no replies]
by mzzz
About dynamic memery,allocate with new, free with delete[]
 
i know if use new to allocate a block of a specified type, and must use delete to free them,in this case, if use delete will result in memory leak. but, wh...
[2 replies] Last: thank you, it helped. (by mzzz)
Reading a line of text with the spaces
 
Hi guys, This site has helped me a lot regarding some programming techniques. I would like to ask another help. This is about reading a "txt file" and...
[14 replies] Last: Yosh!! I learned a lot. I'm not that good in programming because I a... (by jemeripol)
Find the lowest number
 
This is a simple program I am building to find the average of 5 grades where the lowest grade is dropped. I created a function findLowest() which accepts the 5 ...
[2 replies] Last: Maybe you can use loop here instead of series of if-else's. :) (by jemeripol)
Compiler Error
 
My compiler does not update with my edits in the codes in C++.. It still displays output from previous edits. I'm using Dev-Cpp 5.7.1 MinGW 4.8.1 on Wi...
[6 replies] Last: @Albatross, Yes, I am using Code::Blocks now. And I can say that it w... (by jemeripol)
by lionki
anyone know this simple algorithm
 
here the algorithm : s = 0 for i=1 to n do s = s+i*i return s first time i thought it was sieve of eratosthenes's algorithm but i don't even know what i am le...
[4 replies] Last: thanks guys, i helped (by lionki)
Enum vs enum class C++11
 
What is the difference between enum and enum class in C++11? I think it is about type safety, but I need a better explanation. Thanks in advance...
[4 replies] Last: Now I get it. Thank you very much! (by memberfunction)
Read all values /strings form unknown file
 
Hi guys, I'm having a little problem: For an assignment I have to write a program which basically converts 8 bit binary numbers to ASCII and outputs the ass...
[6 replies] Last: He's a great guy. :) (by jemeripol)
by jodytj
Error Checking
 
// My error checking is not working and I have been unable to figure out why? //driver.cpp #include "List.h" #include <iostream> using namespace std; ...
[no replies]
Calling base function from derived overloaded function
 
Here is a sample of my question class Base{ public: int getNum(); private: int numToGet; } class Derived: public Base { p...
[1 reply] : Sorry, i forgot to change my getNum function to a constant function. W... (by yoslick11)
Please help with arrays homework (in C)
 
I'm having trouble figuring out how to calculate the mode. We're not allowed to use pointers (except for qsort) nor linear linked lists nor dynamic variables, n...
[2 replies] Last: The Mode is the most frequent number. I'm sure there's a more efficie... (by kbw)
Create a function that makes a copy of a private map
 
So I'm doing this project: http://www.gamedev.net/topic/409907-c-workshop---project-1/ For now I've done a function that creates menus and prints them, and a...
[11 replies] Last: ///////// player.h //////////// // ... struct player { std::st... (by JLBorges)
November 2014 Pages: 1... 2021222324... 32
  Archived months: [oct2014] [dec2014]

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