General C++ Programming - August 2014 (Page 18)

Why I can't get access to a private function?
 
I've written a simple class given below. I had set the values through setab() function but the add()function didn't work. Compiler shows CPP/class.cpp|20|error...
[5 replies] Last: But is it not possible to get access into a private function? Isn't t... (by coder777)
meaning of class type
 
Hi. I know what it means to say type int or bool or char but what does it mean to say class type. For example class Myclass {} Myclass variableName; So...
[7 replies] Last: would the variables in constructor be allocated memory sequentially? ... (by AbstractionAnon)
Scientific Receipts: VecDoub problem
 
(Note: I posted a similar thread in StackOverflow but got no answers). I am working on a code that is based on what comes with the Numerical Recipes (3rd ed.) ...
[5 replies] Last: Maybe you meant VecDoub OctaveSumAll . The way it's defined now, Oct... (by helios)
getline() adds another line to the output
 
Hi, Taken from Accelerated C++ book, I modified those code to use getline() instead of std::cin >> only to find out that the output has extra line. Could anybo...
[4 replies] Last: There are a number of differences between your example and the source ... (by Duthomhas)
by Algast
Extra empty line appearing using cout
 
Hi, I am new to c++ and have started creating a dummy program to perform a simple task of writing a few strings to the console, which are first generated usi...
[1 reply] : We would need to see at least the definitions for the functions you ar... (by Zhuge)
Help me please
 
#include<conio.h> #include<windows.h> #include<stdlib.h> #include<string.h> #include<time.h> #include <stdio.h> void loading(); void gotoxy(int x, int y); ...
[1 reply] : You have a number of compile errors. Line 20: Your functions need... (by AbstractionAnon)
by Null
Cannot upload file with libcurl
 
Hello, I'm trying to upload a file to a FTP server with curl. The problem is that I do not know what to do after I enter the passive mode and open the specifie...
[4 replies] Last: Any reason why don't you use libcurl own example ? No particular reas... (by Null)
binary file read and struct
 
#include <iostream> #include <fstream> using namespace std; struct details { char name ; int age; }; in...
[5 replies] Last: Got answer here http://www.cplusplus.com/forum/beginner/70211/ (by csstudent123)
by LB
Why does an abstract class need to call its virtual parent constructors?
 
http://ideone.com/tmdzkn #include <iostream> struct A { A() = delete; A(int x) : x(x) { } virtual ~A() = 0; int x; }; A::~A() = default; struct B : vir...
[2 replies] Last: OK, so it's a compiler bug - thanks! (by LB)
by Kubani
Inheritance by using FLTK
 
Hello guys, This problem is completely understandable for who has used book PPP (http://www.stroustrup.com/programming1.html) and has installed and used the ...
[2 replies] Last: Thank you very much for your guide. The below code gave the result. I... (by Kubani)
Stacks: [Error] 'exit' was not declared in this scope.
 
So our professor asked us to make a project where we will need three files (two .cpp files and one .h file) This is regarding our topic about Stacks. When I com...
[1 reply] : exit() is declared in the header <cstdlib> (or <stdlib.h> for C pr... (by Chervil)
Does a realloc to smaller memory result in the same pointer
 
Hi all Just a quick question ( I could probably test this out for myself...but I'm lazy... ). If I do this: void* testPtr = malloc ( 1000 ) And then this: ...
[2 replies] Last: Cheers, I guess I'll trial the function my self and examine its behavi... (by SuperStinger)
Simpe Playing Card Deck Creator and Shuffler
 
This is a playing card deck creator and shuffler i made yesterday. It is very simple now, but i believe that it could easily be implemented into a card game pro...
[1 reply] : #include <iostream> #include <string> #include <ctime> #include <algo... (by JLBorges)
Can I get help with this code?
 
In C++ language please!!! Suppose we have a set of data consisting of ordered pairs and we suspect the x and y coordinates are related. It is natural to try t...
[1 reply] : Please note, that this is not a homework site. We won't do your homewo... (by keskiverto)
Trying to make a Grid in DirectX
 
I am trying to make a grid in DirectX, but I keep getting the error "Access violation writing location" for some reason. This is my code for defining the grid:...
[5 replies] Last: I just figured it out thanks to this website: http://www.toymaker.info... (by jheard901)
Simple question about strings
 
Hello, can someone please tell me what I need to do to make this work? #include <iostream> #include <string> using namespace std; int main() { string str; ...
[2 replies] Last: Thank you :) (by TheRealAnonymous)
by sambid
gui programming
 
I have previously experienced with c++ console programming with turbo and dev c++ compilers but now i want to move on to a graphical interface for my college pr...
[1 reply] : The usual multi-platform answers to this question are: Qt, SFML[+ opt... (by Ganado)
C++ Program Freezes/ Fails to Continue Randomly
 
I'm currently learning C++ and I am working on a text-based game: battleships. It all works fine except the part that is concerned with generating the PC's ship...
[3 replies] Last: Hi, I have some thoughts to improve your code a bit. I completely f... (by TheIdeasMan)
While loop problems
 
How do i write my coding in DEV C++ using while loop for this question : Write a program to display a number in text format. The input from user is valid if ...
[1 reply] : You can use std::cout to display a number. std::cout << number; ... (by Peter87)
Quicksort Descending Order?
 
I've tried Googling my question, and I've tried experimenting with my code on my own, though I'm not sure how to reverse my Quicksort. int partition(int us...
[7 replies] Last: You were not messing with the correct lines. Remember, your compariso... (by Duthomhas)
August 2014 Pages: 1... 1617181920... 25
  Archived months: [jul2014] [sep2014]

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