49,757 Topics

Member Avatar for
Member Avatar for boschow

Hi all, it is possible to declere a function within a structure, then in the main function with the use of the pointers call this function and assign the specific parameters . To make my idea clearer check out the sample code. [code] struct { int AND_function; int math_funct; int …

Member Avatar for asa22
0
147
Member Avatar for chintan_1671

I have a managed class library developed in C#. Now i need to create a win 32 dll wrapper around it. So in my Win 32 DLL i need to import that class library and call the starting point functions from it. I am new on this. I was able …

Member Avatar for chintan_1671
0
259
Member Avatar for daviddoria

I have a class that has a function called Update(). I have written several different update methods, so I now have: [code] class MyClass { double Update1(); double Update2(); double Update3(); private: float Data1; ... float DataN; }; [/code] All of these functions need access to all of the data …

Member Avatar for mike_2000_17
0
105
Member Avatar for daviddoria

I'm having trouble with this "strict weak ordering". Consider a class Point with members x and y. I tried to make the comparison "If both the x values are less than each other and the y values are less than each other, the Point's are less than each other". However, …

Member Avatar for daviddoria
0
220
Member Avatar for VernonDozier

Here's the code. [code] #include <iostream> using namespace std; int a = 0; int foo() { a++; return a; } int main() { if(1 || foo()) { cout << "Hello World\n"; } cout << a << endl; return 0; } [/code] Result : 0 is displayed. Change line 15 to …

Member Avatar for Ancient Dragon
0
169
Member Avatar for caut_baia

Hi everyone.I'll just get to the point.I want to write objects of type B to a file in binary form using fstream and it's 'write' member function.I need to pass a size for an object of type B but since it contains dynamic data and i can't use just a …

Member Avatar for Labdabeta
0
644
Member Avatar for stompjrkz400

ok everyone, i taking my first semester of C++ and i have a little quesiton, the teacher wants up to output and input on the same line, but to send the input through i have to strike enter, which keys to the next line, heres my code, just cant get …

Member Avatar for Labdabeta
0
281
Member Avatar for wingmark

Hi All; Where is the best place to find C++ tut's that are easy enough to follow so that i can start learning C++? Regards Wingmark

Member Avatar for Labdabeta
0
108
Member Avatar for Legend32A

I am trying to replace all % with %%, because I want to write a string to a file using the fprintf_s function. Yet, I done this: [CODE]void replace(std::string& target, const std::string oldstr, const std::string newstr) { unsigned int x; while(x = target.find(oldstr), x != std::string::npos) { target.erase(x, oldstr.length()); target.insert(x, …

Member Avatar for Legend32A
0
97
Member Avatar for thecoolman5

Hey, I am trying to make a program where when you click on a button, the button will open a new window and on that new window has different buttons you can click on. I use DEV-C++. Any solutions?

Member Avatar for thecoolman5
0
430
Member Avatar for bkoper16

I keep getting a error that says invalid conversion from int to int here is my code sales report.h [CODE] #ifndef SALESREPORT_H #define SALESREPORT_H // No description class SalesReport { public: // class constructor SalesReport(int[]); int Salary(int[]); void DisplaySalary(int[]); }; #endif // SALESREPORT_H [/CODE] sales report.cpp [CODE] // Class automatically …

Member Avatar for jonsca
0
769
Member Avatar for wijithapaw

hi all.. Im using visual studio 2005. I want to import log4cxx.dll to my project. if you know how to do this please reply to this thread thank you wijitha

Member Avatar for sgollapu
0
1K
Member Avatar for Frostyyy

I am working on a function, which is suppose to read the size of the binary file and read the data flags. The output is suppose to look something like The dataFlags are: 1 0 1 The size of the file is: 40. I got my code running, but doesn't …

Member Avatar for jonsca
0
124
Member Avatar for atticusr5

I feel bad for asking all the questions about the STL list, and thanks to those who have been helping me learn. I have a question now about inserting again, except this time I want to insert an extra data point into a tempList. I have commented out the code …

Member Avatar for GDICommander
0
184
Member Avatar for kutuup

I have a Tree class that holds pointers to Player objects. Here is the code: [code=c++] #pragma once #include "Player.h" class Tree { private: public: Player* root; Tree(void); ~Tree(void); void DisplayInOrder(Player* localRoot) { if (localRoot != 0) { DisplayInOrder(localRoot->leftChild); localRoot->Display(); DisplayInOrder(localRoot->rightChild); } } Player* Find(const Player* key) { Player * …

Member Avatar for kutuup
0
119
Member Avatar for Zjarek

I was researching this topic for a some time, but I can't find definite answer (and I don't hope to find it there). Is it feasible to do heavy computations using C++? I mean specially computations on large multidimensional arrays. C++ has mechanisms which can help writing quite clean optimised …

Member Avatar for mike_2000_17
0
203
Member Avatar for maikens

Hi all, I am tryiing to figure out how to tokenize a string consisting of words in alphabetical order, all crammed together with no delimiters. I can't for the life of me see how this could be done without analyzing the string beforehand and hard coding a delimiter in. Example …

Member Avatar for pseudorandom21
0
235
Member Avatar for Alice1990

what is wrong with the ifstream and ofstream? I had try again and again and the info shown run to infinity. :( I tried a lot of times ady, will be glad if anyone can help, thank you :) Sorry if its looks messy, still learning all the way. [CODE] …

Member Avatar for Ancient Dragon
0
181
Member Avatar for kutuup

Hi, I'm trying to run a program I have coded that has the following setup: There is a tree containing "player" objects. Each "player" object has a linked list containing "weapon" objects. Each "weapon" object has a stack containing "round" objects. I need to set it up so that of …

Member Avatar for kutuup
0
215
Member Avatar for FrancisLazo

Hi there guys I can't seem to get the logic on how to put the total price of tickets bought in a movie reservation program. For example, a ticket price is sold for $2 and a customer reserved more than one seat, the price should add all the tickets bought …

Member Avatar for FrancisLazo
0
117
Member Avatar for jmcorpse

This is what I am suppose to do: Write a program that maintains a high score table of five entries, where each entry is made up of a player's name and score. The table should store the entries in order, from highest score to lowest. Your program should initialize the …

Member Avatar for triumphost
0
182
Member Avatar for ntrncx

as always since i am not student i study for hobby from a book, i dont ask for code or tell me the answer only for advices to help me understand better things its the first steps of a moving knight in a chessboard,i had to make it move randomly …

0
82
Member Avatar for lochnessmonster

what would be the most efficient method in timing the execution speed of one of my functions?

Member Avatar for Narue
0
45
Member Avatar for zxzniczxz

using c++ and SubRoutine. Problem1: Design a function-oriented program that computes the total of the squares from 1 to n which n is supplied by a user. ex. 12345=1+4+9+16+25=55 Problem2:Design a function-oriented program that computes the factorial value of an input N by a user ..Display the computed factorial value …

Member Avatar for hag++
0
147
Member Avatar for lgonzo

learning to use string and iterators, and i am having trouble when i try to replace a string in my vector with a new one my trouble is starting when trying to replace a string( towards end of code) i get error with line myIterator = vectorGameList.push_back("teris"); idk, how i …

Member Avatar for lgonzo
0
164
Member Avatar for melmakrani

Could somebody help me please?! I'm trying to include math.h in a simple program an it doesn't work. I got following errormessage:"fatal error C1083: Cannot open include file: 'math': No such file or directory". I've checked if math.h is in the include directorie of visualC++, and it is. Here is …

Member Avatar for bbman
0
1K
Member Avatar for duq_nies

Actually, I'm still new in programming. So that, please help me to do this job. This is for my mini project. I've search before, but didn't found the code that use Microsoft Visual C++ 2010 Express Edition as a compiler. Please,.A.S.A.P.

Member Avatar for Ezzaral
0
43
Member Avatar for akshayinbox

Hello. I've learned programming in Visual Basic 6 followed by turbo C++. I was able to make COMMERCIAL software using VB6 but not with C++. The thing is I need to learn a language (for software development) that has syntax and logic similar to C++ BUT COMES WITH AN INTERFACE …

Member Avatar for John A
0
231
Member Avatar for lochnessmonster

WriteProcessMemory(processHandle, address, name.c_str(),sizeof(name.c_str()),NULL) | | is this third argument valid for this function? if not how would i make my std::string return the start address of a c string??

Member Avatar for Narue
0
96
Member Avatar for pete_g

Hi guys (and gals) I'm pretty new to c++ and programming, but I am keen as hell I bought a boot to start learning by Bjarne Stroustrup - Programming - Principles and Practice using C++ I am up to Chapter 3 and doing the 'exercises', only I am stuck on …

Member Avatar for pete_g
0
168

The End.