49,761 Topics

Member Avatar for
Member Avatar for goody11

I'm trying to load a bit map but the picture won't come up. It compiles just fine. I'm not sure if this makes a difference either but I am trying to load a bitmap into a dialog box. Here's the code: The .cpp file: #include "windows.h" #include "resource.h" HBITMAP g_hbmHang …

Member Avatar for goody11
0
178
Member Avatar for poliet

Hello! I want to use static_cast<int> on a void* member Variable in another class. (class aMessage). aMessage class has a public variable void* pVar. While using static_cast on a local variable is running smoothly, I get a compiler error trying to cast it on the aMessage->pVar. pVar is being declared …

Member Avatar for poliet
0
211
Member Avatar for sara9111

# include <iostream> using namespace std; int main () { int arr[100], num, sum=0, size=0; cout<<"Enter an integer: "; cin>>num; if (num < 0) num*=-1; while (num != -999 && size < 100) { arr[size]=num; size++; cin>>num; for (int j=1; j<size; j++) { for (int i=0; i<size-1; i++) { if …

Member Avatar for StuXYZ
-2
146
Member Avatar for tomtetlaw

How do I call a function that gets passed as a paramater? like this: and how do i store it as a variable? [code=c++] void a_func(void(*func)(void)) { //how do i call func? //this gives me an error: func(); //is this hwo to store the function as a var?-> void* this_func …

Member Avatar for mrnutty
0
107
Member Avatar for forever23

Hello I need some tips regarding line striping i.e, number of lines joining with the indices and vertices in GUI using c++.

Member Avatar for zoner7
0
74
Member Avatar for alexa12345

For Input 4 15.01 15 3 3.01 The value of 'avg' is becoming 9.00. I don't understand why this should be 9.01. Please help. [CODE] #include<stdio.h> #include<math.h> double round(double x) { return floor(x * pow(10.0,2.0) + 0.5)/pow(10.0,2.0); } int main() { //freopen("10137.txt","r",stdin); //freopen("out1.txt","w",stdout); long i,n; double sum,avg,sum1,a[1005]; while(scanf("%ld",&n) == 1 …

Member Avatar for tux4life
0
131
Member Avatar for ryBowk

hi all, i am very new to programing and i have just writen a calculator for measuring building marerials, the program works great, but it dosn't look to pretty. how can i get my calculator to work in a window, instead of the default dev c++ command window thingy i …

Member Avatar for Frederick2
0
113
Member Avatar for Eric_

Hi I want to play a sound using directsound. As you can see i'm stuck already. [CODE] #include <dsound.h> #include <iostream> using namespace std; int main(void) {//CREATE OBJECT LPDIRECTSOUND8 ppDS8; HRESULT hr = DirectSoundCreate8(NULL, ppDS8 ,NULL); cout << hr; Sleep(2000); }[/CODE] I get the following error: 1>.\main.cpp(9) : error C2664: …

Member Avatar for Eric_
0
179
Member Avatar for goody11

Hey, I'm working on a Spanish program and I want to make it so that if somebody wants to type in an a with an accent all they have to do is press the pushbutton. I realize how to create the pushbutton but I don't know how to just insert …

Member Avatar for goody11
0
152
Member Avatar for Nogat21

Hey i have a problem about file copying. I have a source file opened with fstream and a destination file opened with FILE*...im trying to copy a chunk of the source file into the destination (the function receives as parameters the start second on the source file in which we …

Member Avatar for Nogat21
0
87
Member Avatar for kodak

I am working with TWordApplication that ships with Borland Builder6. I don't seem to convert to C++ successfully from MSDN examples. I manage to open word from my app and paste text from the clipboard. I have used Select() to select the entire document, but can't work out how to …

Member Avatar for kodak
0
128
Member Avatar for chaithanyap

[code]#include<iostream.h> #include<conio.h> class A { int a[10]; char name[10]; public: void read(); void display(); }; void A::read() { cout<<"enter rno name"; for(int i=0;i<3;i++) { cin>>a[i]; cin>>name; //cin>>a[i]; } } void A::display() { //cout<<count; for(int i=0;i<3;i++) cout<<a[i]<<name; } //int A::count; main() { clrscr(); A x; x.read(); x.display(); getch(); }[/code] here i …

Member Avatar for chaithanyap
0
127
Member Avatar for goody11

Hey, I can't figure what is wrong with this part of my program. I know that it has something to do with that my variable i is exceeding the vector boundaries but I can't figure out how to stop it. I try to make the program exit before the vector …

Member Avatar for vali82
0
179
Member Avatar for the great

Hello! I am having a problem with my program.I have made a program that prints the four different shapes one after the other. But the program should print these four different shapes side by side. I know there should be one outer loop for this but I am unable to …

Member Avatar for Sky Diploma
0
140
Member Avatar for duggydiggy

Greetings All, I was wondering about how a build process goes on in Vc++. I want to know that is there any intermediate assembly file generated while building a source file as what happens with gcc. If the answer is no ,then why gcc build process has this ones step …

Member Avatar for Hiroshe
0
73
Member Avatar for NickyU

I 'm making a game in C++ and I need some help, I want to display a bmp image. I want to read a a bmp file and save the color ids in a matrix. Could you please help me. :)

Member Avatar for mrnutty
0
724
Member Avatar for atch

Hi, I've got problem with method ignore from cin. This is my code: [code=cplusplus] void _name() { string name; char ch = 0; bool name_accepted = false; cout << "Enter your name: " << endl; while (!name_accepted) { while (ch = cin.get()) { //cin. if (isalnum(ch) || isspace(ch) || ispunct(ch)) …

Member Avatar for atch
0
179
Member Avatar for jake43

Can anyone help me to program standard deviation? Here is the instructions for this program: Write a program that takes as input five integers and outputs the mean and standard deviation of the numbers. If the numbers are val1, val2, val3, val4 and val5, the mean = (val1 + val2 …

Member Avatar for Tom Gunn
0
618
Member Avatar for jake43

I need help to sort this numbers, but the problem is it won't like i want it to be with the decimals. I tried changing the int to double but then the program will not run. Here is the code, please provide feedback. [code=cplusplus]#include<iostream> using namespace std; // function prototypes …

Member Avatar for mrnutty
0
204
Member Avatar for Shaitan00

Currently I have 2 applications that reside on the same system (local applications) that need to communicate. One is a C++ program that already uses mailslots to communicate with other system (remote) and the other is a new C# service I have just written. Given that the C++ application is …

0
73
Member Avatar for Belthemet

Hello. Currently I'm making a game in C++, its not my first game (Examples of what I've made is "The game of life" in both 3d and 2d, TicTacToe with my own AI algorithms (based on the graph theory), 2D Paratrooper game), however its my first programm that requires allot …

Member Avatar for Belthemet
0
152
Member Avatar for dennis.wu

c++: Why the member functions of one class can access to private data member of other object? I use vs2008 and g++ compiler. the codes are list below: [CODE=c++] #include <iostream> using namespace std; class Integer { int i; public: Integer(int ii) : i(ii) {} const Integer operator+(const Integer& rv) …

Member Avatar for dennis.wu
0
142
Member Avatar for selsium

could any one please help me to solve this error? error LNK2019: unresolved external symbol _Underst_Sql referenced in function _main 1>cartmot.obj : error LNK2019: unresolved external symbol _Read_Desc referenced in function _main 1>cartmot.obj : error LNK2019: unresolved external symbol _Assegna referenced in function _main fatal error LNK1120: 3 unresolved externals …

Member Avatar for WallyBags
0
71
Member Avatar for WallyBags

"return type may not be specified on a constructor" I am getting this error in VS10. Here's my code: (the error appears on the word class) ComplexNumDec.h [CODE][COLOR="Red"]class[/COLOR] ComplexNum{ private: double real; double imag; public: ComplexNum(double x, double y); ~ComplexNum(); ComplexNum operator+(ComplexNum x); ComplexNum operator-(ComplexNum x); ComplexNum operator*(ComplexNum x); }[/CODE] …

Member Avatar for WallyBags
0
2K
Member Avatar for lahiruchandima
Member Avatar for Ancient Dragon
0
84
Member Avatar for dzhugashvili

hello. I need help implementing an SSE2-accelerated MD4 implementation. I found one that I think may work at [URL="http://www.freerainbowtables.com/phpBB3/viewtopic.php?f=6&t=904&start=30"]http://www.freerainbowtables.com/phpBB3/viewtopic.php?f=6&t=904&start=30[/URL] it is the post by Corni: [QUOTE]“So, I took a crashcourse in how to implement MD4 and in what the hell is SSE2 and how do you use it, and implemented …

Member Avatar for dzhugashvili
0
138
Member Avatar for mybluehair

Hi. I have a c++ game where you make money throughout the game, and the game saves it to a separate txt file. When the game opens back up, it grabs the info in that txt file and puts it into a variable. Thats not the problem though. I'm adding …

Member Avatar for Protuberance
0
81
Member Avatar for yakovm

Hello I need a database 1)I need easily to find a minimal value in the database 2)I want to easily add and remove values(well its trivial I know) I tried to use STL map but I couldn't find an easy way to implement the first requirement. Thank you in advance

Member Avatar for ithelp
0
81
Member Avatar for jko2326

How do I read two different data types from a .dat or .txt file? For instance I have a file that is an inventory file that shows the item reference number, the item name, and the quantity available. Example of what the file may look like: 01 Textbook 54 02 …

Member Avatar for Protuberance
0
148
Member Avatar for beau_nerdathen

[TEX]Please help me about my project "Array Alphabet"[/TEX] this is the example output: a b c b c d e d c d e f g f e d e f g h i h g f e * I don't know how to start the program. Give me ideas. …

Member Avatar for mrnutty
0
92

The End.