49,761 Topics
| |
[CODE] class Matrix { public: int M; int N; double *ptr; Matrix(int m,int n)//constructor takes two ints { M = m; N = n; ptr = new double[M][N]; assign(M,N);//call function } void assign(int M,int N)// method { for(int i = 0; i < M;i++)// i is a row { for … | |
hello i have a problem to solve for a commandline-programm: there are several types of inputs to get and these can look like: keyword1 <double> value1 <double> value2 keyword2 <double> value1 keyword3 <double> value1 ... I just can't figure out how to do it! thanks! | |
Hi, lets say i have [CODE]class Players{ public: vector <strings> info };[/CODE] and class that inherits from it [CODE]class son:public Players{ };[/CODE] now in the main function i make 2 of those so now i have 2 vectors in memory that vector holds the same data for all of the … | |
Hi, I'm a beginner to C++ and am having some trouble with my list. I first define a struct named "bullet' like so: [code=c++]struct bullet { bool alive; bullet() alive = true; };[/code] Then, I create a list of objects of type "bullet": [icode]list<bullet> bullet_list;[/icode] In my program, I frequently … | |
Hello all i am just getting into using windows forms. I have been looking around on the internet for like a day now and cant seem to find any good code on how to add a table with columns , rows and labels on the top of the columns. I … | |
Fun game for the raging compulsive alchoholic gambler, such as myself. Although the game may vary among casinos, the basic premise is the user picks 10 numbers out of 80. The computer will randomly draw 20 numbers out of 80. If you matched with any of the computer picks, you … | |
I am new in programming. I have this problem in coding. i somehow have the idea but i could not simply do it in codes. can anyone add to complete my program. The problem is I enter 10 numbers and i need to sort them ascendingly. #include<iostream> using namespace std; … | |
I use Visual Studio 2010 Ultimate. After fixing one of my problems, I ran into another. I have 2 files in my project named, let's say, A and B. The problem is when I try to run the code from B, VS outputs code from A. Any ideas on how … | |
Hello, everyone! I made an account on this website because I'm having trouble with a particular program. I'm supposed to be writing a Polynomial class with a linked list to hold coefficients and an integer for the degree. I keep getting a fatal error LNK1561, though, and I don't know … | |
I think I have the logic mostly down for this part of the program. However, I am using an implementation of a header file, and in [B]BST::Insert[/B] I am handed a [B]const std::string &v[/B]. For all I know, it is doing the right job passing it off to [B]InserRecursive[/B], but … | |
Hey there,I'm looking for assistance with my simple code here. Why do my integers ( x,v,z,d,e,f,g,h ) suddenly change when the program reaches the " printf("The decimal value is... " part? Is there something I'm missing? [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int Binary[7],x,v,z,d,e,f,g,h; Binary[0]=x; Binary[1]=v; … | |
I have an assignment to get the area and perimeter of a rectangle. I have to set the width and length to 1 initially and use set and get functions. I have the following code but am not getting the correct answers for area and perimeter. Any suggestions? Rectangle.h [code] … | |
[CODE] #include<stdlib.h> #include<conio.h> #include<stdio.h> #include<iostream.h> struct pro { int no; int btime; int atime; int stime; int etime; int wtime; int ttime; int rtime; }proc[100],junk; void sort(int n) { pro temp; for(int i=0;i<n;i++) for(int j=0;j<n;j++) { if(proc[j].atime>proc[j+1].atime) { temp=proc[j]; proc[j]=proc[j+1]; proc[j+1]=temp; } } } pro min(int n,int & t) { … | |
[QUOTE]I was given this project as a part of my school assignment, please note that I have very limited knowledge of the language, and my teacher won't allow using anything other than what is used in the following code (Crappy 12th grade curriculum:yawn:)... Here is my complete code, its in … | |
Hello, I have a strange problem. I am trying to use the tesseract library in my own project. First, I have used it in a new project, just to test it, and everything has gone fine. After that, I have integrated in a bigger project in the same way as … | |
Hi, I'm having a problem with using the streamWriter to write to a unicode file. Code as follows: [CODE] for(int i = 1; i < 1018; ++i) { std::wostringstream integer; integer << L"IDS_STRING" << i << L"\t"; wstring thisString = integer.str(); thisString = thisString + L"\"Spare String\""; wchar_t* SpareString = … | |
i am a beginner in visual c++ and using visual studio 2010, i have came across a scenario where i want a dialog screen to appear in a full screen mode like our youtube video screen. i was successful to make the dialog box appear on the full screen , … | |
I am trying to launch a process using CreateProcess() I have to modify the Path environment variable as well as add some environment variables of my own. What I am doing is I get the parent's environment block using GetEnvironmentStrings(). I basically copy the parent env block and only modify … | |
I read a LOT of tutorials on bitmaps. I learned that RGBQuad is for 32 bit bitmaps and RGBTripple is for 24 bit bitmaps.. I'm planning on getting pixel information from a bitmap that can be of 3 types. 24bit, 32bit, 32bit with alpha (Transparent). Thing is, I don't know … | |
Hi ,I am trying to implement merge sort with list and I have this error in this code [COLOR="Red"]invalid use of void expression[/COLOR] list<string>::iterator LIST_ITER; sz is the size of the list beg beginning of the list end end of the list Thank you in advance [CODE]void merge_sort(LIST_ITER beg, LIST_ITER … | |
HI everyone, like my last post stated I am new to programming so be patient with me. I am having a hell of a time writing this program and I was hoping some of you might be able to give me some quick pointers on the structure I should use. … | |
I am writing a program about giving change. But I am having issues with getting remainders for decimal numbers. For instance I am giving $46.63 change I want to know how many $20.00 bills it has, I would have to divide it by 20. 46.63 / 20 = 2.3315 My … | |
Write a program which asks the user to write some text before analysing it to see how many occurrences of each vowel appears in that text, you should store the number of occurrences of each vowel in an array of size 5. (Hint: use qin for this, with the ‘Return’ … | |
Hay guys, i wanted to get the code for a very large factorial but i was unable to do so. Now, i had to work and develop the code myself, which i did. This code calculates factorial of numbers uptil 14000. . i havent tried more. But i guarantee this … | |
I've written a program to add two hexadecimal numbers ... Njoy ! tux4life | |
I want to make a mouse controlled camera the problem is that i want to rotate over the space not the current object but I don't know how to calculate the changes on view transformation. Here is the code example: [CODE] D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3 (0.0f, 0.0f, CurCamRot.z), // the camera position … | |
Hi, I have an app created in Borland Builder 6, on Win 7, but I tested it on Win XP, and font's size changed, some forms resized... This guy has explained the problem >> [url]http://www.tek-tips.com/viewthread.cfm?qid=1668509[/url] Anyone experienced with this? | |
something is wrong with my dequeue function. When i try to output the value that's about to get deleted i get garbage on the console window. the enqueue function works fine. [CODE]class Queue { private: int value; Queue *next; public: void dequeue(); void enqueue (int num); }; Queue *head=NULL; void … | |
hello everyone! i'm writing a program using linux environment and i'm curious about the use of waitpid().i have searched the command on google but i'm not sure i understood the return values of the command. for example i want to use it as follows: [CODE]if(waitpid(-1,&status,WNOHANG )>0) sum++; [/CODE] where sum … | |
I am trying to build a console project using Microsoft Visual C++ 2008 Express. I included a static third-party library (no source code available) by adding the name to the Additional Dependencies (in Project Properties\Linker\Input). Additionally, I added the path of the folder where the ThirdPartyLib.lib is to the Tools\ProjectsAndSolutions\Directories … |
The End.