49,761 Topics

Member Avatar for
Member Avatar for acv528k

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 …

Member Avatar for Fbody
0
129
Member Avatar for Mona..

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 ); …

Member Avatar for xikkub
0
1K
Member Avatar for kyuu

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 …

Member Avatar for Fbody
0
167
Member Avatar for Philosophy

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 …

Member Avatar for Philosophy
0
256
Member Avatar for svampizen

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 …

Member Avatar for alexchen
0
50
Member Avatar for MixedCoder

[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 …

Member Avatar for gerard4143
0
264
Member Avatar for Jason Giggs

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.

Member Avatar for Fbody
0
113
Member Avatar for newbiecoder

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.. …

Member Avatar for jonsca
0
171
Member Avatar for eagle_isea

hello ..... please how can i write a function (PRINT) that takes a stack of integer and print its elements?

Member Avatar for Jason Giggs
-1
61
Member Avatar for muffle

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 …

Member Avatar for muffle
0
182
Member Avatar for Norzog

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 …

Member Avatar for Clinton Portis
0
91
Member Avatar for lokis

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.

Member Avatar for AndreRet
0
183
Member Avatar for sha11e

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 …

Member Avatar for Jason Giggs
0
114
Member Avatar for aviavyne

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 …

Member Avatar for Clinton Portis
0
253
Member Avatar for knellgust

[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 …

Member Avatar for jonsca
0
99
Member Avatar for brycematheson

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 …

Member Avatar for xikkub
0
156
Member Avatar for berwick53

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, …

Member Avatar for taylorc8
0
174
Member Avatar for JeremyJ

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 …

Member Avatar for JeremyJ
0
732
Member Avatar for shizu

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, …

0
78
Member Avatar for taylorc8

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 …

0
102
Member Avatar for pichi20

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 …

Member Avatar for pichi20
0
1K
Member Avatar for Toxic_Rice

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 …

Member Avatar for Toxic_Rice
0
232
Member Avatar for newbiecoder

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 …

Member Avatar for skorm909
0
112
Member Avatar for gnarlyskim

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 …

Member Avatar for Calista Flock
0
2K
Member Avatar for rebellion346

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 …

Member Avatar for rebellion346
0
229
Member Avatar for CHawk619

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 …

Member Avatar for CHawk619
0
150
Member Avatar for digan

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 = …

Member Avatar for arkoenig
0
94
Member Avatar for PieterA

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 …

Member Avatar for PieterA
0
192
Member Avatar for kerp

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 …

0
177
Member Avatar for nickx522

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.

Member Avatar for WaltP
-2
66

The End.