49,757 Topics
| |
[COLOR="Green"][B]Well, that's it, i'm trying to compile a dialog box:[/B][/COLOR] [CODE] case WM_COMMAND: switch(LOWORD(wParam)) { case ID_HELP_ABOUT: { int ret = DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUT), hwnd, [COLOR="Red"]AboutDlgProc);[/COLOR] if(ret == IDOK){ MessageBox(hwnd, "Dialog exited with IDOK.", "Notice", MB_OK | MB_ICONINFORMATION); } else if(ret == IDCANCEL){ MessageBox(hwnd, "Dialog exited with IDCANCEL.", "Notice", MB_OK | … | |
We are running an application in win32/Vista, and sometimes, something has changed the permissions so we can not access them. We have a admin co-process that can change the permissions, but I am not sure what functions to call to insure that we have permission to access the files, from … | |
Hi, I am working on visual studio 2008 C++ and I have done the C++ general code, my question is can I convert my general code to be C++ CLR in visual studio 2008? This will make my work easier. And I have one more small question is I have … | |
Hello all, I have a project in which I need to open an external file which contains to columns of numbers ie: 1000 1000 1111 500 1500 1000 2000 900 2222 2000 2500 2000 3000 1500 3333 2000 3500 2000 4000 600 4444 2500 4500 2000 5000 2500 5500 2222 … | |
My program deals out 7 cards. And then determines what is in the hand. A pair, two pair, three pair, four of a kind. However its not finding any of those right and im not sure why. [CODE]#include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> using namespace std; #include "DeckOfCards.h" … | |
can I call a function B outside a class (say, a global function) from a member function Aof that class? if so, how do I specify the scope? Using :: B ? thanks. | |
Memo.h: [CODE=cpp] #ifndef _MEMO_H #define _MEMO_H #include <stdlib.h> #include <string> #include <typeinfo> #include <iostream> #include "Date.h" #include <map> #include <vector> using namespace std; class Memo { public: map<Date, vector<string> > Appointment; //void delMemo(int x); void addMemo(Date myDate,string x); }; #endif /* _MEMO_H * [/CODE] Memo.cc [CODE=cpp] #include <stdlib.h> #include <string> … | |
How to assign the graphic object (Line, Rectangle, Ellipse) to the Form? Lets see this example: I created the Line object somewhere in the program: [CODE]namespace TEST_Graf { using namespace System::Windows::Forms; // this code requires links to: PresentationCore, PresentationFramework, WindowsBase using namespace System::Windows::Controls; using namespace System::Windows::Shapes; using namespace System::Threading; public … | |
Hi, When using Microsoft Visual Studio, building in release the code just hangs and fails to execute but with Debug it builds and runs to the end. And I don't see why there should be a difference. I did a shutdown then clean and a rebuild of solution but the … | |
I'm using [code=php] for (int i = 0; i<mdim_; i++) { for (int j = 0; j<ndim_; j++) { data_[j * ndim_ + i]; } } [/code] to change the matrix 1 3 2 4 stored in data, into row order. If I print data_[j * ndim_ + i]; to … | |
[code] void encrypt::transform() { int length = 0; char *buffer; char ch = ' '; int i = 0; fileEncrypt.open("filter.txt", ios::in | ios::beg); fileEncrypt.seekg(0, ios::end); length = fileEncrypt.tellg(); fileEncrypt.seekg(0, ios::beg); buffer = new char [length]; fileEncrypt >> ch; while(!fileEncrypt.eof()) { buffer[i] = ch; i++; fileEncrypt >> ch; } for(int j … | |
anyone help me please I need to convert this C++ to assembly int number = 0; int targetValue = 1; int nbrTerms = 0; cout<< "enter number" cin >> targetValue; while( nbrTerms <= targetValue) { nbrTerms = nbrTerms + ( targetValue * targetValue) targetValue ++; } cout<< "total terms: "nbrTerms; … | |
Hello again all, I have a project in which I need to read in a text file: 1000 1000 1111 500 1500 1000 2000 900 2222 2000 2500 2000 3000 1500 3333 2000 3500 2000 4000 600 4444 2500 4500 2000 5000 2500 5500 2222 5555 2000 6000 1999 this … | |
[code] // fibonacci2.cpp : Defines the entry point for the console application. #include "stdafx.h" #include<iostream> using namespace std; int fibonacci(int n)//declare function { //declare variables int x1 = 0; int fib ; int x2 = 1; if(n >= 1) { for(int i=2;i<= n; i++) { fib = x1 + x2; … | |
I have a 2x2 matrix A stored in data_ 1 3 2 4 (column major order) and a 2x2 matrix B stored in b.data_ 5 7 6 8 and I'm using the function below to append (stick underneath) B to A. so my result should be 1 3 5 7 … | |
I'm trying to find a formula for copy[3] = b.data[0] copy[4] = b.data[1] copy[5] = b.data[2] copy[9] = b.data[3] copy[10] = b.data[4] copy[11] = b.data[5] letting the right hand side be b.data[i], I can see this is like copy[3] = b.data[0] multiply by 2, add 3 copy[4] = b.data[1] multiply … | |
I am a very new beginner so please excuse my ignorance. I literally started learning c++ 3 days ago. I am attempting to read a file and split each line into 2 arrays. The first half the line is just text and i would like to store it for re-output … | |
Hi, I've been working on a sudoku game, which seems to be working pretty well so far. I've managed to make a basic solver, and the interface is pretty nice :icon_cheesygrin: But i'm having problems trying generate a random unique sudoku. I need to be able to create 3 different … | |
Hi fellow forumers...I am new to this forum and programming. Regarding the above topic..Is there and code that solves this sort of question? My question:A program that input 10 integers and find the largest value. Thanks very much! | |
I need help with inserting a string for both key and value to a map. [code] while(!myHuffFile.eof()){ string word, code; int freq; myHuffFile >> word >> freq >> code; if(word == ""){ break; }else{ _fileMap.insert(pair<string,string>(word,code)); _freqMap.insert(pair<string,int>(word,freq)); } } [/code] error: error: conversion from `std::_Rb_tree_iterator<std::pair<const std::string, std::string> >' to non-scalar type … | |
i dont knw why i am not getting the right ans can someone help? [CODE]#include<iostream> #include<string> #include<cmath> using namespace std; int main() { int sum=0; string val; cout<<"enter a binary number:"<<endl; cin>>val; for(int i=0;i<val.size();i++) { cout<<val[i]; } for(int i=1;i<val.size();i++) { int x = val.size(); sum+=val[x-i]*pow(2.0,i-1); } cout<<sum; return 0; } … | |
i cant get this to loop and i cant get it to error trap cout << " Please choose an odd number 3-9 to calculate width and height of your choosing\n"; cin >> number; [CODE]do { if((number!=3) || (number!=5) || (number!=7) || (number!=9)) { cout << "invalid choice " <<endl … | |
I am trying to get a variable number of arguments in one function, and pass them to another function. I tried this: [code] #include <iostream> #include <stdarg.h> void Function1(unsigned int num, ...); void Function2(unsigned int num, va_list ap); int main(int argc, char *argv[]) { Function1(3, 1, 2, 3); return 0; … | |
1.Password authentication Write a C++ program that has asks the user to enter a string-input. If the string matches the password stored in the program, then print a suitable welcome message, otherwise allow the user to re-enter the correct password. The user has at most 3 chances to enter the … | |
Hi, I am using Visual Studio 2008 Express Edition, and I wrote my code as follow: ====================================code starts [CODE]#include <iostream> #include <string> #include <sstream> using namespace std; int main() { string *p; int n; cout << "Please input the number of students"<<endl; cin>>n; p = new string [n]; cout <<"Please … | |
Hey, can someone tell me where I have to start? I wanna make a program like cheat engine but I have no clue how :o... Im [B]not[/B] a beginner ( but also not an expert :P ) in C++(/CLI)... What functions do I need? etc. :p Thx ;D | |
I have same problem during compilation: [CODE]..\\..\\..\\hal\\include/waiting-point.hpp: At global scope: ..\\..\\..\\hal\\include/waiting-point.hpp:7: error: expected type-specifier ..\\..\\..\\hal\\include/waiting-point.hpp:7: error: expected ')' ..\\..\\..\\hal\\include/waiting-point.hpp:7: error: expected initializer void operator delete(void*) ..\\..\\..\\hal\\include/waiting-point.hpp: At global scope: ..\\..\\..\\hal\\include/waiting-point.hpp:15: error: expected type-specifier ..\\..\\..\\hal\\include/waiting-point.hpp:15: error: expected ')' ..\\..\\..\\hal\\include/waiting-point.hpp:15: error: expected initializer void operator delete [](void*) void MyVector<T>::reallocVector(size_t) MyVector<T>::MyVector() MyVector<T>::~MyVector() bool … | |
I have: [CODE]void hughint::operator *=(hughint y) { int i,t1,t2,prod,remainder; int carry=0; for(i=num.length()-1;i>=0;i--) { t1=(int)get(i)-(int)('0'); cout<<"t1: "<<t1<<endl; t2=(int)y.get(i)-(int)('0'); cout<<"t2: "<<t2<<endl; if(carry>0) { prod=(t1*t2)+carry; remainder%=10; carry=remainder/10; } } }[/CODE] I'm using 123*100 and the answer I keep getting is 123. Help please. | |
i must write a program that will convert lower case letters to upper case and vice versa and if a number is entered it must display char is not a letter here is what ave written but when i run it it does not do the conversion.thanks //to convert lower … | |
I am very new to C++ and I want to make a program that converts a binary number (up to seven digets) into a decimal value. Anyone know how I can do this? |
The End.