49,757 Topics
| |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 | |
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, … | |
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? | |
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 … | |
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 | |
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 … | |
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 … | |
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 * … | |
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 … | |
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 … | |
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] … | |
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 … | |
| 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 … |
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 … | |
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 … | |
what would be the most efficient method in timing the execution speed of one of my functions? | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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?? | |
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 … |
The End.