49,757 Topics

Member Avatar for
Member Avatar for benny2010

so heres the problem, i have been working on this asteroids game for a week or so now but i cannot for the life of me figure out how to work the direction properly. at the moment the only thing the ship does is move up the screen. The functions …

0
56
Member Avatar for DoubleH

Hello, I have this assignment I'm supposed to deliver tomorrow, I have most of it figured out, but there are certain bits and parts of the question I can't figure out... I'll show you what I mean, here's the entire question: [CODE]Develop two linked lists to manage the list of …

Member Avatar for NathanOliver
0
179
Member Avatar for sheennave

The application has a screen size and resolution problem . What should be done since it looks very funny on desktops .

Member Avatar for sheennave
0
103
Member Avatar for Labdabeta

I am working on making a 'safetype' abstract class, which will have a complete set of pure virtual operator overloads to help make sure that a class inherited from it is safe to pass to virtual any function. The problem is that I don't know the syntax of a pure …

Member Avatar for Labdabeta
0
244
Member Avatar for WildBamaBoy

I'm learning C++ and just finished a tutorial on pointers. I understood what they were and how to use them but I do not understand when they should be used. When would it be practical to use a pointer to get a value instead of using the value's name? For …

Member Avatar for WildBamaBoy
0
170
Member Avatar for Ardgari

I am a humble programmer who is about to lose his remaining sanity at trying to get FTGL and/or FreeType working with Visual Studio 2010. FTGL is version 2.1.2 and FreeType is version 2.4.4. Inside of the project directory I have freetype.dll and ftgl_dynamic_MT_d.dll, and I have linked to the …

0
51
Member Avatar for Razzo1

Well I am coding a small intermediate program to help me with learning c++ , and i am wondering how to check for blank input to cin >> string heres what i have [CODE]string name; cout << "Enter You're Name: "; getline(cin, name); [/CODE] and if i just hit enter …

Member Avatar for mike_2000_17
0
2K
Member Avatar for Labdabeta

I am working on making an error header file and this is what I have: [CODE]#include <stdio.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <string> #define VANARGS(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34,n35,n36,n37,n38,n39,n40,n41,n42,n43,n44,n45,n46,n47,n48,n49,n50,n51,n52,n53,n54,n55,n56,n57,n58,n59,n60,n61,n62,n63,N,...) N #define __VA_NARGS__(...) (VANARGS(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) #define ERROR(...) (\ (__VA_NARGS__(__VA_ARGS__)==0)?"NONE":(\ (__VA_NARGS__(__VA_ARGS__)==1)?(_1(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==2)?(_2(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==3)?(_3(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==4)?(_4(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==5)?(_5(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==6)?(_6(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==7)?(_7(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==8)?(_8(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==9)?(_9(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==10)?(_10(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==11)?(_11(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==12)?(_12(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==13)?(_13(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==14)?(_14(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ (__VA_NARGS__(__VA_ARGS__)==15)?(_15(__VA_ARGS__,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)):(\ …

Member Avatar for Labdabeta
0
255
Member Avatar for w1mark

I noticed that using a switch statement, the case always has to be a constant character or integer or it won't compile. It's sorta of a bummer as the only alternative is using a bunch of if/else if's. So doing something like this won't work: [CODE]switch(aString) { case "word1": doSomething(); …

Member Avatar for Agni
0
226
Member Avatar for eduard77

I try to make an exercise that involves classes. I reached until this point [CODE] #include <iostream> #include<math.h> #include<iomanip> #include<conio.h> using namespace std; class Cplx { double re, im; public: //constructors Cplx(double x=0, double y=0); Cplx(const Cplx& z); //accessing the members double real() const {return re;} double imag() const {return …

0
56
Member Avatar for L3gacy

I've been having a hard time understanding classes but i've got it mostly down(atleast I think) well below in the code I overloaded the + operator for my class called clr which uses strings, my problem is on lines 59 and 61(strcpy_s(tmp,len,other.buffer);) when I strcpy to tmp the word is …

Member Avatar for L3gacy
0
4K
Member Avatar for gerard4143

Hi, I'm looking for a good book on Qt 4 programming, I checked both chapters and amazon but couldn't locate a Qt book with favorable reviews and was wondering if the daniweb members knew of a good text...Thanks in advance. Gerard4143

Member Avatar for gerard4143
0
110
Member Avatar for bleedsgreen33

My professor has thrown me a curve ball with this next assignment. The assignment is to make a Monthly Accounting Statement, the program is to you structs and arrays. I get how you can have an array of structs, arrays within a struct, etc... I have the program mapped out …

Member Avatar for Ancient Dragon
0
362
Member Avatar for francisp94

3 months ago me and my classmates played with visual c++ 6.0. We made a infinite loop of numbers that kinda looks like the matrix thing. We changed the font of the cmd of c++ to green. Now the problem is I can't turn it back to normal. I tried …

Member Avatar for tkud
0
191
Member Avatar for NoNameHere

Input text file as an array? For example if the text file contained something like //names and grades Bob 98 92 66 90 Sara 88 75 39 85 Joe 92 99 99 12 Would it be correct to do [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; void …

Member Avatar for Ancient Dragon
0
75
Member Avatar for shantanusinghal

[code=c] void Assembler :: pass2(ifstream &inHandle, ofstream &outHandle) { outHandle<<setfill('0'); while(!inHandle.eof()) { inHandle.getline(src_line,50); //declerative or imperative statement if(toascii(src_line[0])>=48 && toascii(src_line[0])<=57) { breakStatement(); outHandle<<address<<")\t+ "<<mnemonicCode<<" "<<regCode<<" "<<setw(3)<<operand<<"\n"; } else outHandle<<"\n"; } } void Assembler :: breakStatement() { int i=0,j=0; char oprCode[20],oprClass; ifstream in; //initializing all variables strcpy(address,NULL); strcpy(mnemonicClass,NULL); strcpy(mnemonicCode,NULL); init(oprCode); regCode='0'; …

Member Avatar for shantanusinghal
0
241
Member Avatar for Zjarek

I am making basic project for "Computer simulations of polymers and biopolymers" using Monte Carlo simulation and I currently have access only to ASUS eee PC netbook. Could anyone run attached program on a faster hardware for input data [ICODE]100 50 50 1000000[/ICODE]. Last part of data is number of …

Member Avatar for Zjarek
0
110
Member Avatar for ktsangop

Can anyone please give me a guideline on how to code the following? I have an MFC application which should call on a timer basis a python script from command line and read the ouput of that command line. I thought of using CreateProcess, but i have no clue of …

Member Avatar for ktsangop
0
421
Member Avatar for eduard77

I try to make an exercise from a book and I have only one error. On this line [CODE]cin >> t;[/CODE] it writes me that "more than one operator >> matches this operand" I know that defined this operand before in another way but I don't know how to solve …

Member Avatar for jonsca
0
185
Member Avatar for imhiya

I have two files; one with places then the distance between them. Example: Moffat Carlisle 65 Doncaster Hull 76 Northampton Birmingham 90 Leicester Lincoln 82 Sheffield Birmingham 122 I was wanting to use dijkstra's method, but i seem to have a problem because looking pseudo codes to understand it they …

Member Avatar for VernonDozier
0
153
Member Avatar for Zvjezdan23

I have trouble saving my numbers. I used an array for my saving feature. As you play the game, the computer asks you if you want to save a number. you say yes and you pick which number(s) you wish to save. My problem is, if i save 2 numbers …

Member Avatar for stav141
0
140
Member Avatar for tomtetlaw

I use CRT memory leak checking in my program, when it closes, it produces this output: [code] Detected memory leaks! Dumping objects -> c:\program files\microsoft visual studio 9.0\vc\include\crtdbg.h(1203) : {133} normal block at 0x003B6938, 4 bytes long. Data: < 5 > 00 00 35 00 c:\program files\microsoft visual studio 9.0\vc\include\crtdbg.h(1203) …

0
73
Member Avatar for ninjatalon

What are the purposes of using ifndef and define? When should it be used and why? I made a simple program in class just to go over the basic of Friends in classes but it wouldn't work and I was getting errors all over even though I went through it …

Member Avatar for Fbody
0
113
Member Avatar for raven_007

[QUOTE]programing turbo c[/QUOTE] how can i make a moving name program going round and round my monitor in turbo c and i need this 5 days from now!

Member Avatar for chrjs
-1
75
Member Avatar for beejay321

The problem for my CMPT103 class is to write a program that takes a binary number as an integer and returns it as a decimal, i would be able to do this easily by taking it as a charecter array and dealing with each individual element but i dont understand …

Member Avatar for WaltP
0
432
Member Avatar for thekitoper

I am fairly new to c++, and I would like to know whether or not I need to have the library files present on the system to run a compiled program that used the library files to compile on a different system. Thank you.

Member Avatar for gerard4143
0
91
Member Avatar for thekitoper

[CODE] int main(int argc, char* argv[]) { std::cout << argc << std::endl; } [/CODE] The code above will print a number depending on the number of arguments added to it. However I am writing a game in c++/python and I need the program to accept a integer argument that will …

Member Avatar for thekitoper
0
125
Member Avatar for Harley_Quinn

Allrite so I'm writing this program - and I've been having some trouble with it - there are three parts to it 1. Write a function [CODE]void tolower(char* s)[/CODE] that replaces all uppercase characters in the C-style string s with lower case letter. - Two helper functions to use a)[CODE]bool …

Member Avatar for jonsca
0
180
Member Avatar for daniel1977

Dear Friends: I am having trouble with this exercise. I was able to compile and create the list 0-7 and reverse. I am not sure where I went wrong. Thanks Danni #include <stack> #include <iostream> using namespace std; template <class stackType> void reversedStack(const stackType & originalStack, stackType &reversedStack) { stackType …

Member Avatar for JamieLynnSEO
0
74
Member Avatar for anu07

I am getting a "misplaced break" error from this part of the code,the following is a part of the mfile function,the while loop should break if the entered string in temp equals to the one in exit....I don't know why it shouldn't work,any help?Thanks. [CODE] ofstream myfile; myfile.open(fn,ios::ate); cout<<"File has …

Member Avatar for anu07
0
806

The End.