49,761 Topics
| |
(A) Write a C++ program to sum all odd integers divisible by 3 in the range (X,Y). Integers X and Y are to be input by the user. Your program should validate that X is smaller than Y, and output error message if not. Note: Use whileloop for the validation … | |
First off thanks for looking at this I have looked all over (both here and on the net) and tried several things trying to get this to work. I am using Visual Studio 2012 with DirectX (June 2010) SDK. I am attempting to write a fuctuin for sprite colission detection. … | |
Hello everyone! I have a rather mysterious problem. I have a mfc dialog based application (running on win xp sp3), and at the same time another mfc app that installs a global keyboard hook capturing the ESC key (this one is always hidden). SOMETIMES when i press ESC key (with … | |
Hello, I have been given a class diagram where a variable called light_years must be a const int and stored in the space class, but later on that value must be used in the main file. Below is the space class class space { private: static const int LIGHT_YEARS; public: … | |
I'm trying to compile a project using Code::Blocks with a MinGW compiler (Windows XP). I have included the correct library file from boost and set the right include path but it doesn't seem to make any difference. Here's the error. The impression I'm getting is PdfContentsGraph class is not initializing … | |
I'm using fstream to read words from a file and I can't just read the whole word like so: ifstream ob("file.txt"); string word; ob >> word; But I need to somehow specify to read 20 positions, even though there might be just spaces included. So I was trying to do … | |
So, I'm trying out a project on my own because I have no real clue how to do anything complex or useful in C++ (applications for example). This project calls for creating a simple console text editor with basic functionality (buffer, command set, redisplay). The problem is that I don't … | |
Hello I am trying to connect MySQL database from C++ code given below- My development environment is - Window 7 CODE::BLOCKS 10.05 with minGW mingw32-g++.exe MySQL Connector C++ 1.0.5\lib\debug\mysqlcppconn.lib Up to compilation and linking every thing is OK I followed the tutorial [http://dev.mysql.com/doc/refman/5.1/en/connector-cpp-examples-complete-example-1.html](http://dev.mysql.com/doc/refman/5.1/en/connector-cpp-examples-complete-example-1.html) #include <stdlib.h> #include <iostream> #include <winsock2.h> /* … | |
I am planning on making a program to so that when it is excecuted it carries out the following procedure in 1 go... run command prompt ( system("CMD"); )...then use the command line to carry out the following command... "C:\Program Files\PowerMenu\PowerMenu.exe" -hideself on Im sure i have seen this done … | |
Hi I am currently making a dialog based application in visual c++ 2010 where a chart is going to plot data coming in from an external source. My issue is that I am unsure how to import that data in real time to my application. Does anyone have ideas? Thanks | |
This program has taken roughly 3 months to develop and now I would like other people to evaluate it for me. It's called Math Tool and it can be useful for you're tring to find out an average of data (i.e. average time) and it's also useful to display it … | |
Input the minutes, then the seconds, and it will do the rest. Pretty simple but I just thought I'd post it. Made as a quick test for my game. | |
I thought i would share this with the community wrote most of it in school but the ai i wrote at home enjoy! | |
Hello! I'm terribly confused about how to pass a simple integer that was read from my main() to another function (in the same file). I know this is a really silly issue, but searching on the internet is just making me more confused. Here's my code so far. #include <iostream> … | |
Hi, I have spent way to much time stuck on this with no clue how to do it. My program is a phone book directory. I'm writing a funciton that when the user enters a phone number to be deleted the program will delete that corresponding entries info. So it … | |
i want to learn animation in c++ please help | |
MOST WEB BROWSERS HAVE A HISTORY OF THE PAGES THAT USERS HAVE VISITED.WHEN FIRST THE USER ENTERS A WEB ADDRESS,IT IS STORED IN THE PAGES VISITED.WHEN THE USER CLICKS A LINK IN THE VISITED PAGES,THAT PAGE IS ADDED ON TOP OF THE PREVIOUSLY VISITED PAGES. THE USER CAN THEN PRESS … | |
Well, I have just written all of this code, and then made lots of edits, compiled and when I run it, I get STATUS_ACCESS_VIOLATION. And I can't work out where the error lies. It is a very basic Database program BTW. Here is the code: http://pastebin.com/jLktEL3C And here is the … | |
I made a test program to mess around with a feature I'm trying to put into my class project but I can't seem to figure out what I'm doing wrong. What I'm trying to do is to line up the numbers right of the decimal. this is my test source … | |
Hi, In Dialog based MFC code (VC++ 2012), I have two command buttons and 1 Text Box 1. Enquire 2. Start Once the user chooses ENQUIRE Button, I display msg in TextBox "Press START for the ....." In the Start Button code, I do the socket opening,accept functions etc while … | |
Trying to make a little space exploration game, and I'm just testing some planet data stuff, and it won't work. I don't get any errors until I compile it, then I get an error message saying that "vector subscript" is out of range. main.cpp: #include <iostream> #include <conio.h> #include <string> … | |
How do I keep a timer running in the background in my program? I'm making a game and I need to time the player. | |
shader.vert: #version 120 varying vec3 position; varying vec3 normal; void main() { position = (vec3(gl_ModelViewMatrix*gl_Vertex)); //get the position of the vertex after translation, rotation, scaling normal = gl_NormalMatrix*gl_Normal; //get the normal direction, after translation, rotation, scaling gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } shader.frag: #version 120 varying vec3 position; varying vec3 … | |
**C++ Code:** #include <iostream> using namespace std; int sum(int n) { if (n <= 0) return 0; else return n + sum(n-1); } int main() { cout << "Range num? "; int num; cin >> num; cout << sum(num) << endl; return 0; } **My Pep/8 try at it:** br … | |
Hello, I'm working on a text base space game, just for fun, and I've made a lot of progress. The problem I'm having right now is that sometimes, the psuedo-random is calculated out of its modulus. The way it works, as you can see in the code is that a … | |
[CODE] #include<iostream> #include<fstream> #include<string> using namespace std; struct phonenode{ char surname[15]; char initals[4]; phonenode *next; }; phonenode *start_ptr = NULL; phonenode *crrnt_ptr; void read_txt(){ ifstream ifs("test.txt"); char surn[15]; char inital[4]; phonenode *temp1, *temp2; temp1 = new phonenode; if (ifs.fail()){ cout << "ERROR" << endl; } while(ifs.good()){ ifs>>surn>>inital; if(ifs.fail()){ break; } … | |
I want dynamically define an array b in input() I'm trying like this where int size=9; int b*=new int[size][size] But getting many error while compiling Thank you for any guidance Regards | |
Can you please help me and tell me what I am doing wrong? I have been looking at the program for two hours and need help. I keep getting this error: 'triangle' was not declared in this scope. Also, that is the only error, so I don't have anymore. Thank … | |
i Need to create a Menu Driven program ..but cant understand what it is ..some one help me out and explain me . | |
This is my code class AddResult { private: string ar_stu_id, ar_mod1, ar_mod2, ar_mod3, ar_mark1, ar_mark2, ar_mark3; public: void addresult(); AddResult(string, string, string, string, string, string, string) { cout<<ar_stu_id <<" " << ar_mod1 <<" " << ar_mod2 <<" " << ar_mod3 <<" " << ar_mark1 <<" " << ar_mark2 <<" " … |
The End.