49,761 Topics
| |
Writing a program that reads a string of arithmetic expression from the keyboard and evaluates the arithmetic operation in the string. Some example runs are given below. program should accept only * any real or integer numbers * four basic arithmetic operators, +, -, *, / * paranthesis ( , … | |
Hey, I'm trying to compile a simple producer-consumer program with Qt, using QThreads. I get this error message when trying to compile: [CODE] In file included from /usr/include/qt4/QtCore/QThread:1, from producer.h:4, from mainwindow.cpp:3: /usr/include/qt4/QtCore/qobject.h: In copy constructor ‘QThread::QThread(const QThread&)’: /usr/include/qt4/QtCore/qobject.h:309: error: ‘QObject::QObject(const QObject&)’ is private /usr/include/qt4/QtCore/qthread.h:60: error: within this context In … | |
| I'm making a dialog based text editor, using dev-c++. how can I insert text at the current cursor position? as in get the location of the cursor (not the mouse) and insert text at that point in the edittext control |
My question is when user enter any key from the keyboard including arrow keys, it should print one asterisk * , when user will again press any key it will add one more asterisk and ,and when user again press any key from keyboard it should add one more asterisk, … | |
Hi. I want to read a file and scan the file to see if the file contains 0x000001 (24 bits, 23 zero and 1 one bit). if file contains 0x000001, return a "yes", else return a "no". I tried writing the program but cannot work. I am stuck with this … | |
My code compiles and runs but does not do what I want. It is NOT allowed to change main(). I'm trying to build Base(almost like how i typed), Derived classes and type their member functions. [CODE]//--------------------------------------------------------------------------- #include <vcl.h> #include<iostream> #include<fstream> #include<stdlib.h> #include<conio.h> using namespace std; #include <vcl.h> #pragma hdrstop //--------------------------------------------------------------------------- … | |
I need to identify, for example, when we hit a text box in a web page, we get a "| " key sign right (Which would blink, until we type) If you don't get what i am saying, go to google and click on the search text box, u would … | |
Hi Pals, I am Anes , from Kerala ,India. I am a PHP Programmer Basically but have interest and now studying C++ , I plan to take data from MySql in C++, for that I install mysql-connector-c++-1.1.0-win32.msi in my Windows XP. I got a Script from net , but it … | |
Hi, so I finally got around to looking into OOP in c++ and I have a question about classes. So I made this simple class: [CODE]#include <iostream> using namespace std; class Shape { int xPos, yPos; public: Shape(int x, int y) { xPos=x; yPos=y; } } ; int main() { … | |
Hey guys. First of all, I've only been a CSCI major for a semester (had one course in Java, loved it, and switched from my almost completed math major). With this in mind, I hope you can understand that I'm pretty new to the scene. That said, during the semester … | |
I am using VS2008, OS win Vista. I need to create a C++ windows form program to add a .swf flash animation to the form. How is this done. Any sample code, or a good tutorial is appreciated. | |
In C++, I know that if I need to read something from a file, I can do this: [CODE=c] int x; ifstream ifs("data.txt"); ifs >> x; [/CODE] However, is there a function that simply returns the value of whatever I'm feeding in? For example, if I had this: [CODE=c] bool … | |
How to change numerical values from scientific notation to normal system (:P) in C++ if i used a float or double variable Cuz i want decimals tthats why i used float but now its giving me the answer of my program in scientific notation ? or is there any way … | |
Hello guys, Do ++/-- are atomic operations in c++? Thanks | |
Question : Please Copy array A into 1st portion of array F .assume float a[11], f[34]; im using compiler Borland 5.02, please tell me hows so far my code is correct? [CODE] #include<iostream> #include<conio> main() { float a[11],f[34]; int i; for (i=0;i<11;i++) { cin>>a[i]; } for (i=0;i<11;i++) { f[i]=a[i]; } … | |
Hello, Can anyone make sure the two functions are correct? First, this is function should return true if all of the nodes are positive.otherwise, false. [ICODE]bool AllPositive(Node * h); { node* current= head; while (current !=NULL) { if (current < 0) { return false; } else { return true; } … | |
hey dudes... I need help... To figure out how to design a gui in c++..... . | |
hey my mam told me that we can run any c and c++ program while booting... He tells me to figure out....... So need ur help... | |
Hi everyone! I'm trying to creat a class calling INT, which is equivalent to type int. I think we must creat every operator for this class like: +, -, *, /, %, pow(x,y),... I've never seen how does type int look like? May someone give me a introduction to type … | |
this code was workin when i used srand function to fill th e array with random numbers and the array was a declared globally.But now the code is not working.I cant find anything wrong in this .Sombody pls help.. [CODE=CPP] #include<iostream.h> int *a,NUM_ITEMS; int main() { void enterdata(); void quicksort(int,int); … | |
| This should be easy. Haven't writen a C++ app in over 10 years. Trying to delve back into it. Will someone be kindley enough to show me a sample Function and Procdure Name the function AnyFunction that returns and integer. Name the procedure AnyProcdure Heres my .h and .cpp [code] … |
I have this code here but it doesn't seem to work; int answer1[10]; int answer3[10]; char answer2[11]; char answer4[11]; answer1[i1]= answer2[i2] - '0'; answer3[i3]= answer4[i4] - '0'; answer2 and 4 are numbers except in charactor state. answer1 and 3 doesn't equall to answer2 and 4; Can some one help; | |
Hi, I tried doing Project Euler #27 today, which asks the following: [QUOTE] Euler published the remarkable quadratic formula: n² + n + 41 It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 40^(2) + … | |
Can any one please assist with code for two objects coming from different direction. Subsequently, collide after intersection. The objects should be moving at 80km/h. And collision should happen shortly 30 minutes after take off | |
Hi i am new to programming and i decided to go straight to C++ and i am starting to grasp it. so i am trying random codes using my current knolage(Bad spelling) to make them. But i am trying an if else statement using my name and my brothers name. … | |
Hello! I am learning SDL on lazy foo site! I have a problem with this code what does it mean? what is the "/2" stand for? apply_surface( ( SCREEN_WIDTH - message->w ) / 2, ( SCREEN_HEIGHT - message->h ) / 2, message, screen ); Please help! | |
I’ve been told to convert a standard C++ program into an object-oriented one, using the principals of polymorphism, encapsulation and inheritance. I would appreciate any help // Purpose // A program to demonstrate the application of a simple digital filter // // Overview // A sequence of data items and … | |
Hi guys, I have been away from programming for a while and i started back today now that i have some time again. However i have run into a bit of a brick wall. im trying to impliment a queue with a simplified interface for holding messages. What I have … | |
Well the following code I used to run graphics.h functions in windows xp CODE: int driver,mode; driver=DETECT; mode=DETECT; initgraph(&driver,&mode,"c:\\tc\\bgi"); Without this code functions of graphics.h (circle, line, arc etc.) did not run But in windows 7 this code is not working c++ is showing errors ….Well I am using the … | |
HI THERE .... CAN any one tell me; how to draw a straight line(639,0) with black color and on white back ground in borland c++ 16bit compiler; i know how to set white back ground but the straight line is a real problem if any one can ans this plz … |
The End.