49,761 Topics
| |
i'm trying to make a password system for my program. a user will input upto 20 chars, and if the password is correct, load the main program and if not, loop until the user gives up or enters the correct answer. here is the code [CODE] void Password(char pass); int … | |
It may have only been Visual C++ 6.0 or something, but I think I remember needing to add curly braces after a switch's case label to declare variables, is this still true with VS2010 and C++? ex: [code] switch( 1 ) { case 1: { int a; //<-- ok } … | |
Im currently wanting to open a file on my Hard Drive, and be able to scan it's contents to see if it has any bytes that match a specific pattern of bytes which i have stored in a byte array. Im curious as to how i can do this? will … | |
What is wrong with this and how do I fix it? Thanks. [CODE] template<typename T> class Array { public: Array(unsigned arraySize): data(0), size(arraySize) { if (size > 0) data = new T[size); } ~Array() { if (data) delete[] data; } void setValue(unsigned index, const T& value) { if (index < … | |
I'm trying to make a program where you enter the number you want to find primes up to which then lists all the primes up to that number... But I enter 100 then it just sits there... Here's my code so far: [CODE]#include <iostream> #include <cmath> int prime(int); int main() … | |
could someone please explain to me the differences of these languages (C, C++, C#) and when i would use them. (i know a little C++) | |
I have read many different threads about how it is not possible to delete values from an array, but I need to find some way to do this. I am making a program that involves a bottom up approach algorithm where it pairs off data segments, finds the best segments … | |
I'm trying to write a program which will generate templates in html.. I try to make a menu in visual c++, rest of code was written in c++ (console). so I have 2 problems... [B]1st PROBLEM[/B] I designed nice clean menu with drop-down menu containing 3 options AVAILABILITY DEGRADATION UNAVAILABILITY … | |
I have the following code: [CODE]for (int w=0; w<10; w++) { //some lines of code unsigned long num = x.to_ulong(); cout << "Decimal form is: " << num << endl; } [/CODE] Now what I want is, to make a matrix which will have these values of num, column wise. … | |
Hey guys , i need some help in understanding this coding. This is a client server code which i got off the internet . The problem i am facing is that when you run the server , the server will continously wait for incoming connections . I would like to … | |
Dear experts, In my application, I am using a custom control that is a GroupBox and a CheckBox instead of a common caption. I got the control here: [url]http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4149[/url] I had to change the code to allow the checkbox to have multiline text: [CODE] CRect rc; GetWindowRect(rc); // Get the … | |
[CODE]std::vector<std::vector<unsigned long> > matrix(15); // 15 rows typedef std::vector<std::vector<unsigned long> >::iterator it_type; it_type row = matrix.begin(); for (int w=0;w<10;w++) { //some lines of code unsigned long num = x.to_ulong(); cout <<"Decimal form is: " << num<< end; // if we've hit 15 items in the current row (i.e. 15 columns), … | |
Here's a defined enumeration: enum shipCost {FIGHTER_COST = 25, BOMBER_COST, CRUISER_COST = 50}; Then they do this which I don't understand: shipCost myShipCost = BOMBER_COST; My question is why don't you just do the following instead? int myShipCost = BOMBER_COST; | |
Hey i am beginner and i read a book about c++,and i like to do all the exercises alone until i find alone the solution. but one of the topics that give me a hard time is recursions. i am on an exercise with the following code. [CODE]#include <iostream> using … | |
Im getting this error while im working on my pig latin code and have no idea what it is referring too. so here is the error and my code. ill specify the piece of code that is erroring. [code] #include <iostream> #include <fstream> #include <string> using namespace std; bool isVowel(char … | |
Thank you for your help so far.I try now to move on with my vector but now comes the hardest part. All the values that the float vector receives must combine somehow that the value of their addition do not overcome 12. So in other words even if I have … | |
I promise I read the Read This First post and also searched for relevant threads, but I didn't have any luck. I'm taking my first C++ class, and the instructor hasn't been much help when it comes to fundamental things like what compiler we should use, where to get it, … | |
I Created a Look_up table class but when I test it with sin() and cos() it is actually slower than stdlib math's sin. This surprises me by a lot. [CODE] inline double MATH_TABLES::GetSind(double& value) { return mp_Sind[(static_cast<int>(value/m_SinPrecisiond)]; } [/CODE] mp_Sind is simply an array of doubles. This is the non-Lerp'd … | |
I'm a college student, about to have an associates degree and start working on my Bachelor's for CS. I have a project that I've been working on for a while now, and I'm thinking about making it open source, and hosting it on sourceforge. The reason I would do so, … | |
Hi, I've just installed netbeans, cause I found out I need to work with C and windows doesn't allow the use of pid_t and fork(). Awesome Job, Gates. Anyway I've found this pretty compiler which is NetBeans. In pair with cygwin it should work out all the C stuff I … | |
Here is my problem: Write a program that reads in a text file and converts it to pig Latin. i.e. if the first letter is a consonant, move it to the end and add “ay” to the end, if it is a vowel add “way” to the end. Here’s an … | |
Hi, [CODE]for(i=0;i<10;i++) { for(j=0;j<10;j++) { if() { Now I want to exit from j loop and continue from i loop. } And now if it is wrong I want to continue from j loop. } }[/CODE] Actually I tried break in if statement but it did not help. | |
Hello, Please help me in my query below: Code snippet 1: [code] Employee *e1 = new Employee(this); e1->setX(); e1->setY(); [/code] Code snippet 2: [code] Employee e1 = new Employee(); e1->setX(this); e1->setY(this); [/code] "this" can be anything. Example, this code is present in a method of another class say Organization. so, … | |
[CODE] #include <iostream> #include <string> #include <cmath> #include <iomanip> using namespace std; int main () { char op= ' '; int cstart, cend, increment, fstart, fend; cout << "This program converts and calculates the increment between" << endl; cout <<"celsius and fahrenheit temperatures"<< endl; cout << endl << endl; op … | |
Hello Everyone: its nice to find this site because I'm just starting to learn C++ and I would welcome any help I can get. Thanks All! | |
Hi folks, I'm a beginner in c++. The other day was trying to multiply 2 matrices using friend function. The program did run ,but the result showed some garbage values. plz help.. #include<iostream.h> class matrix { int a[10][10],b[10][10],d[10][10],r,c,l,m; public: void read (void); void display (void); friend void multiply1 (matrix m1); … | |
i just downloaded qt and i dont know how to build in qt, it keeps saying: Could not find make command: mingw32-make.exe in the build environment Error while building project case (target: Desktop) When executing build step 'Make' Could not find make command: mingw32-make.exe in the build environment Error while … | |
im curious as to if i were to do inline assembly such as [code] __asm { mov eax,0 // more assembly here..... } [/code] does anyone know of how i can calculate how many bytes the assembly code above i produced will use up in my exe? im wanting to … | |
So I've been working on this project for quite awhile now and I can't seem to figure out how to fix all of my errors. If you could run the program, it will appear as 17 errors. So far I don't know where I could of went wrong. Any help … |
The End.