49,761 Topics
| |
Write a program to move a character around on the screen in response to user key-presses (you’ll have to decide which keys to use for up, down, left and right - combinations like t b f and h work well: or if you’re more ambitious you could find out the … | |
#include<iostream.h> #include<conio.h> #include<math.h> void main() { clrscr(); int n,x,i,j; float p,fact=1.0,sum=0.0; cout<<"\n\tEnter the number: "; cin>>n; cout<<"\n\n\tEnter the Value of 'x': "; cin>>x; for(i=1;i<=n;i++) { for(j=(2*j-1);j>0;j--) { fact=j*fact; if(i%20==0) p=(-1)*pow(x,(2*i-1)); else p=pow(x,(2*i-1)); sum+=p/fact; } } cout<<"\n\tThe sum is "<<sum; getch(); } | |
In my program (not the compiler) how would I implement a 'tag' system, for example : dpkg [B]-i[/B] hello I am not skilled enough to go through gcc's or dpkg's sources so sone help would be nice. | |
Hi. I want to read through a file and search for variables saved in it. However if the stream reads the last char I got errors like EOF. For example the following code would not work as intended to : [CODE] bool BaseFileReader::Valid() const { if (!File.is_open()) std::cout << "\n\nERROR: … | |
I have run this code below but it have a few error..hope someone could help me to solve this problem..tq..:) #include <stdio.h> #include <string.h> #include "cv.h" #include "cvaux.h" #include "highgui.h" int nTrainFaces=0; int nEigens=0; IplImage ** faceImgArr =0; CvMat * personNumTruthMat =0; IplImage * pAvgTrainImg = 0; IplImage ** eigenVector … | |
I try to implement ford fulkerson algorithm but i have problems at my_alg function.I think the reason for this problem is find_edge function.since when i find the edge and increment its flow(asker_sayisi),at the next line it seems to be incremented but at the next line when i find the same … | |
hello, i want to get some guidance from the reader who read my post. I'm doing a game called deal or no deal using c++ and i can't think of other way to print the box's number instead of printing the value inside. what i want to do is, user … | |
[CODE]#include <iostream> #include <string> using namespace std; class shapes { protected: int width; int height; public: shapes() { width=0; height=0; } ~shapes() { } void getWidth() { cout<<"What is the width"<<endl; cin>>width; } void getHeight() { cout<<"What is the height"<<endl; cin>>height; } }; class rectangle:public shapes { public: void area() … | |
i want to create dc++ hub using dynamic ip , because my ip is updated automatically after some period of time. I am using DSL(PPPoE) connection. If it is possible to make dc++ hub using dynamic ip then i want full instruction & help so that i can follow to … | |
Hello everyone, I came across the following in a book: [CODE]Keyword typename The keyword typename was introduced to specify that the identifier that follows is a type. Consider the following example: template <class T> Class MyClass { typename T:: SubType * ptr; ... }; Here, typename is used to clarify … | |
I found a good tutorial and added a few things to it such as text on screen using the TTF dll, the code worked fine before setting up the font and attempting to display it. I still get no errors or warnings it just compiles then closes instantly :(, no … | |
How do interpreters do it? I've seen bots for games that encrypt files then decrypt them at runtime and run what's in them.. Well How? How can I do this in C++? I plan to do this in another language but I decided to ask in C++ section because this … | |
I've got a linklist class and would like to have the ability to create a new node that can instantiate it's own new linklist. (some what of a multidimensional link list) I've tried the line: linklist *self = this; but my program crashes when i exit. any thoughts? | |
Hi everybody, I have a crazy problem with a basic calculator. [CODE]#include <iostream> using namespace std; main (){ int num; int y; int ans; cin >> num; for (int x = 0;x < num;++x){ cin >> y; ans += y; cout << ans << endl; } } [/CODE] it take … | |
Is there any reason you would want to write your own RTTI system for use in your code, when there already is one in C++? | |
HI, dears, Can any 1 help me in writing the following program.. i cant do it. so can any1 help me. > Write C++ program that calculates the following Total Runs Total Balls 6s 4s 3s 2s 1s 0s S/R Avg m waiting fr this. This Program is About Cricket … | |
I wanna know what type of parser is used in the gcc and turbo c++ compilers. whether a top-down or bottom-up parser is used..... ? | |
Hi guys, I'm writing a weasel program and needed a random character generator, I used a random number generator to give an ascii code for each character, and made a sequence of them, then I realized I needed to include the "space" symbol, but upon inclusion of the new code … | |
I am in an 11th grade computer science class learning C++ and I feel that the class is going to end before I learn how to apply C++. What I want to know is what do I need to learn to start applying C++ into tasks like software development, game … | |
Hello people I heard, that c++ is more powerful than c and i want to learn one of them. I want to know if it is better idea to start with C or with C++ without learning C. I know a bit of C# (i can make some basic games … | |
Hello. I need some help with variable types. I am currently an 11th grader taking my first Computer science class. I am learning C++ and I would like to know how I can make 10/3 3.33 rather than 3 in C++. For example, a member on the forums updated my … | |
I read that using a policy class for a function that will be called in a tight loop is much faster than using a polymorphic function. However, I setup this demo and the timing indicates that it is exactly the opposite!? The policy version takes between 2-3x longer than the … | |
Hello, and happy new year first of all. What I am trying to do is make a program that according to the values the user inputs then displays a polynomial. The forumla for the polynomial is this: [code]float par(float x) //H timh ths synarthshs sto shmeio Xo { float tel=trap[0][1], … | |
hi everybody, the double type is 8B, right ? So if i use this code : [CODE]double pear[500000000];[/CODE] it will use 4GB of Ram ? or there's a limit for arrays ? thanks | |
I have a feeling that I can come up with a much better title for this thread once I know the answer to this question :). Say I have a function template template <typename T> void MyFunction(). Now I want to specialize MyFunction for a templated type. That is, say … | |
I don't know should I post this article at here or not, if you think this should belongs to other area, please move it to there. I need to design some domain specific language to generate some C++ source codes. I have considered about using xml directly instead of designing … | |
Greetings! I have a C# dll generated from a .resx file (I believe it's called a satellite dll). This stores simple key to string mappings (used for language localization). I was wondering if it's possible and feasible to access the information stored in the C# dll from a C++ unmanaged … | |
Hi there, I'm trying to access a resource only dll (compiled with the [i]/NOENTRY[/i] linker option) within C#. The dll file was created using a rc file that contains a [b]STRINGTABLE[/b]. I used [b]CComBSTR[/b] to load the string resource from the dll in C++; I'm not sure how to do … | |
Hi all, I've been trying to find part of a string in a vector. The problem being that I can only get it to work if I enter the entire string, but I need it so that I only search for the first part of the string in the vector. … | |
I am trying to implement process pairs redundancy (process level redundancy) in c/c++. basically there is a active core process 1 running on one system and its standby copy, process 2, is running on other system. When ever the active one goes down the standby becomes active and executes the … |
The End.