General C++ Programming - July 2011 (Page 18)

Odd error: no match for operator ... in ....
 
#include <iostream> using namespace std; class Node { private: Node * nextNode; Node * prevNode; int data; publ...
[6 replies] Last: I built it and it ran fine for me (Visual Studio 2005). I know its... (by shacktar)
by ouch
is there a way to get the pointer to the object which called your function?
 
ideally something like: void testfunc(int x = 0, void called = this){ called->stuff(x); } which obviously doesn't compile but is there a way ...
[9 replies] Last: yes, except the classes I'm using are coming from a library I'm using.... (by ouch)
creating a managed dll?
 
Hello, I have some source code for a dll and it builds fine and I want to be able to use it in a c# application. I turned on the /clr switch and it creates ...
[no replies]
Analysis of the running time (Big Oh notation)
 
I have a nested for loop and I am supposed to calculate the running time (in Big-Oh notation) of the nested for loop. That is, whether it is linear (O(N)), quad...
[1 reply] : Sounds about right. The middle loop is O(n³) and in addition to that,... (by Athar)
by h9uest
OOP with C++ : concept question --- violate access control by polymorphism
 
Hi all: I find myself a bit confused by the following question. I don't find anything explaining this topic: Question: class Base { public: virtu...
[12 replies] Last: :O (by writetonsharma)
Pure abstract class using operators.
 
Hi all. I'm trying to create a pure abstract numeric class so that I can have an implementation of different number systems but they all are derived from the...
[3 replies] Last: It looks correct...but you are right, it does not like the operators t... (by LB)
DECLARATION PUZZLE
 
hi folks, i am new here,i know some basics in c++. i would like know answer for this question..? #include<iostream.h> #include<conio.h> void main() { int a=...
[4 replies] Last: Don't forget the the literals are still int s. Try: long int a=(30... (by closed account z05DSL3A)
by jorgen
Strange error converting integer to char array
 
I want to write a function converting an integer to a null-terminated char array. Here is the program: void inttochar(char* kchar, int k) { int j; s...
[5 replies] Last: ...also don't forget to delete ch when you are done with it. (by closed account z05DSL3A)
Returning a Block Of Resources
 
I'm unsure about returning memory allocated by a local object within a function, such as malloc( ) . I was thinking something along the lines of: If I allocat...
[5 replies] Last: Thanks, Duoas :) Wazzak (by closed account zb0S216C)
by jeem
7-11 program need your help
 
i need to finish it badly guys.. i need a "search" all that i have add in the output here my code #include <iostream.h> #include <string.h> #include...
[2 replies] Last: Don't call main. Loops are for repetition. I don't know what you want... (by hamsterman)
How can I mask a circle and a triangle by using the Opencv ?
 
If I had an empty circle or a triangle how I can fill this circle or triangle with a black color ?? by using OpenCV
[1 reply] : well, if it's circle , you can fill it by any color just by setting th... (by mimirobo)
Finding Missing Values in an array
 
Hello, I am trying to create a template that determines missing values within a formatted array of 5 integers...for example: int array = {x, x+1, x+2, x+3, x...
[3 replies] Last: hold on a minute .. if ur program is like this: int main() { cons... (by moudiz)
by Luffy
Removing from Vector
 
Hi all, I am new to C++ programming. I would like to remove an entry from a textfile. My coding works fine with the reading portion from textfile, but I am ...
[1 reply] : [co de] "Please use code tags" [/co de] while( getline(cashflow, ... (by ne555)
Why when i load data from a file last one is double.
 
What am I doing wrong. last data from file always double. #include <iostream> #include <vector> #include <fstream> struct Data { int apples; int ...
[2 replies] Last: Thanks that works. (by DrakeMagi)
by shank8
Connect4 Game Help
 
I am attempting to create a Connect4 game with a very basic interface. I have created a general template for the graphics and input of the game. I now need to c...
[5 replies] Last: Now, when you have this function, you could call it 4 times for each ... (by sohguanh)
by LB
Size of a Reference & How a Reference is Handled
 
I am concerned by this test that I performed with references: #include <iostream> using namespace std; class A { short &a; A(); public: A(short &a...
[3 replies] Last: References are actually a fairly complex subject, requiring some speci... (by Duthomhas)
clock type
 
bool clockType:: isEarlier (clockType otherClock) { return (hr>otherClock.hr && min>otherClock.min && sec==otherClock.sec); } this method returns true if th...
[2 replies] Last: the bool is Earlier is not working and i change it up many times thi... (by raymjones)
!!!!can yo help with this program I could not handle with it
 
Write a function that takes a function F (with one independent variable) and an integer N, and then calculates and returns the following sum: F(1)/F(N) + F(...
[1 reply] : I don't see any code or work you've done yourself/ (by Zhuge)
by chulio
problems: (1)dynamic matrix & (2) with global matrix
 
Hello, (1) From the code below: #include <stdlib.h> #include <stdio.h> int **a; // global matrix. int main(void){ int dim = 100; int size_x =...
[6 replies] Last: I have the code below, where the matrix mat is global. #include <io... (by chulio)
Access lines of a TStringList
 
Hello all! I have a question regarding Borland C++ Builder. I am writing a program that needs to access individual lines of a TStringList and turn each line ...
[3 replies] Last: Okay, I think I tried that before, but I'll give it another go now tha... (by Treekanicko)
July 2011 Pages: 1... 1617181920... 30
  Archived months: [jun2011] [aug2011]

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