49,761 Topics
| |
Hello everyone! I'm fairly new to C++ and am having trouble with a "nested loops" problem. Here is the problem: USING A WHILE LOOP, get integers from the user. Then, USING A FOR LOOP, calculate a 'times table' of that number and the numbers between 1 and 20. When the … | |
Hi.. I want to compress a text file which is like this:(input.txt) [CODE] ffa11 ffb13 ffd2 e c e r [/CODE] and save the result in (output.txt) [CODE] #include<fstream> #include<iostream> using namespace std; int main() { char ch; int counter=0; fstream infile; fstream outfile; infile.open( "input.txt",ios::in ); outfile.open( "output.txt",ios::app ); … | |
hi i am making a 16puzzle game and i keep getting error about parameter conversion in main function. maybe someone can help me out and figure out whats wrong? i had this program written with functions and it worked perfectly,but now making it with classes(coz my teacher requires classes in … | |
I am working on an Encryption/Decryption program for class and have run into a problem. I seem to have gotten the encryption correct, but I am unable to decrypt what was encrypted in order to get an output equal to what originally went in. Here is the code I have … | |
Hello Im new with c++ but I'am trying to make a space invaders game.... This is a loop that is shooting... [CODE] if(skott1aktiv) { masked_blit(skott, screen, 0,0,skott1x,skott1y, 32,32); skott1x+=skott1dx; uppdatera= true; if(skott1x>639 || skott1x<0) skott1aktiv=false; } rest(10); } [/CODE] Does anyone know how to make the shoot go up instead … | |
[CODE] #include <Windows.h> #include <iostream> #include <mysql.h> using namespace std; int main() { MYSQL *conn; char names; names= mysql_query(conn,"select * from names"); return 0; } [/CODE] error: Error 1 error C2440: '=' : cannot convert from 'int' to 'char *' i want to set a varuable for the query so … | |
Hey.. Can anyone suggest me must do projects in c++ so that i can become used to it a develop a little confidence. Small games, apps would be appreciated. | |
Hello, as I learned conio.h header file is used in Windows not Linux, I found two things from the Internet 1. Linux c++ implementation of conio.h [URL="http://sourceforge.net/projects/linux-conioh/"]http://sourceforge.net/projects/linux-conioh/[/URL] 2. libconio [URL="http://sourceforge.net/projects/libconio/"]http://sourceforge.net/projects/libconio/[/URL] What should I do to use them? I am not very familiar with C++ and I couldn't find out myself.. … | |
hello ..... please how can i write a function (PRINT) that takes a stack of integer and print its elements? | |
Here is the input.txt file that I have. [code]2 5 -2 3 1 2 4 0 1 2 1 0 [/code] These are 2 polynominals. 2x^5 - 2x^3 + x^2 + 4 and x^2 + 1 while <3,5> : 3 is the coefficient, 5 is the degree. I just can … | |
Hello, I am in a process of making an adventure text-based game and I was wondering if it's possible to change the text color on the go. What I mean is that normally, your text would be white, but when you advance in the story (e.g. advance on lines), the … | |
Hi, This is lokesh from india,completed B.tech (computer science). Right now looking for job. me positive thinking and very confident not over confident. my hubbies are playing chess and traveling long trips and love to make friends around world. | |
I want it to do the following: Ask for a number between 1 and 5, if user inputs anything lower, higher, or something that isn't a number, it should give an error message and then ask for a input again. This code will spam the error message forever, what have … | |
Hello, I have a problem which goes like this. I need to be able to design a simple class, which i have done, and it must represent any numeric value, which includes a decimal and negative value. So i need to overload the operators, because the '%' will make an … | |
[CODE]#include <iostream> using namespace std; class NumDays { private: double hours; double days; public: NumDays(double h=0) { hours=h; days=h/8.0; } void setHours(double h) { hours=h; days=h/8.0; } double getHours() const { return hours; } void setDays(double d) { hours=d*8.0; days=d; } double getDays() const { return days; } NumDays operator … | |
I'm making a Sudoku game. When reading in from a file, I would like to convert all of my "0" to blank spaces. However, no matter what I do, those "blank spaces" always turn to "32" because, that's the value of a space on the ASCII Table. How do I … | |
I've been learning C/C++ and I'm currently doing an ATM project. It all works fine but I would like to improve it so when i quit the program and it will load the data used previously. currently I use a struct like this [CODE]struct database { int pin, sort, account, … | |
Hi, Can someone help me with the CURL library using GCC on Cygwin? I can't find anything in the documents that explain exactly how to compile with g++. For instance: g++ -I curl CurlSample.cpp gives me errors such as: /tmp/ccrXZUYr.o:CurlSample.cpp:(.text+0x17): undefined reference to `_curl_easy_ init' I'm using gcc version 4.3.4 … | |
Hi all.. I am using windows XP with vision studio C++ 6.0.. my software is using CAsyncSocket communication with TCP/IP.. during sending and receiving signal / data.. my software always face communication cannot delivered to server.. sometimes OK..sometimes not.. I called CAsyncSocket::Send(...) function to send data.. sometimes able to send, … | |
Hi, I'm trying to use an input device like a joystick as a mouse, and I've got some good behavior for desktop use by polling the state of the device in a loop and doing some work with the values, then using SendInput with some INPUT structures to make the … | |
Hey, I'd appreciate if someone would help me modify this code so the descending order can be displayed on the screen , here it is.... [CODE] #include <iostream> // ostream #include <vector> #define SIZE 10 using namespace std; int partition(vector<long unsigned int> & a, int start, int end) { unsigned … | |
Hello, everybody! I am kind of new to the forums, and I will do my best to follow the rules when posting a new thread. I am to create a program that is supposed to generate 30 random integers between 10 and 200, and insert them into a Heap. The … | |
hello I have a piece of code starting like that: [CODE] #include <iostream> #include <conio.h> #include <stdlib.h>[/CODE] When I have try to compile this with g++ with a command as:[B] g++ new.cpp[/B] I get this error: new.cpp:2: fatal error: conio.h: No such file or directory I couldn't find where is … | |
Next project in my C++ course is to create a class Polynomial to add, subtract, multiply by a scalar, and multiply by another polynomial. I've written my code, and it works fine when I run it, but there's an application that is provided by our instructor to compare my .exe … | |
So, when I run the program and try to list all the information I get an interesting error message that pops up: ----- Debug Assertion Failed! Program: ...ocuments\Programs\C + + Programs\Checkbook\Debug\Checkbook.exe File: f:\dd\vctools\crt_bld\self_x86\crt\src\tccpy_s.inl Line: 19 Expression: (((_Src))) != NULL ----- Though I have an idea that it probably has something … | |
I have a couple of C++ labs that I need to finish before the end of the semester and I have been beating my head against this computer for days and I am not getting the code to work. I need some serious help. I need to get these done … | |
Can anyone see any way of improving this? [CODE]//____________________________________________________________________________________________ // START #include <iostream> using namespace std; int maxQ, total1; //____________________________________________________________________________________________ // CLASS(ES) class Queue { int array[]; public: //variabes int count; //constructors Queue(); Queue(int q); //functions void add(int i); void take(); }; //constructors initialization Queue::Queue(int q) { array[maxQ]; count = … | |
Hi all I'm having a List of Entity's here which I would like to traverse. I want to call the function DisplayEntity for every node. Here's the catch: I have expanded the Entity class (same name different namespace) to have SDL data and methods. So basicly what I'm trying to … | |
Hi everybody, this text turned out to be rather long and maybe not so clear, please excuse me. I'm currently using the winsock library to send and receive data in an application made with WinAPI, I'm not using MFC. I'm using asynchronous sockets (I think that's what it's called) which … | |
Have a choice to input 3 letters S or P or Q. I need to convert them to upper if user inputs lower cased letters. |
The End.