49,761 Topics

Member Avatar for
Member Avatar for eskimo456

Hi there I am developing a grid system that would generate non-overlapping grid cells. Upon creating a grid I want to be able to check to see if the potential grid overlaps any other grid cells. If it does then clamp the new grid cell to the already existent grid. …

Member Avatar for eskimo456
0
146
Member Avatar for Labdabeta

I have asked this question before on a different forum without success. I would like to know how to do templated type conversions for a class. The syntax is getting me though. Here is what I want: [CODE]class Thing { public: template <typename T> T operator T(); }[/CODE] This would …

Member Avatar for Labdabeta
0
96
Member Avatar for VBNick

Hi, if anybody has a second, I have a quick question: In the following situation, Container can contain any combination of the derived classes. If I wanted to go through "Container", for example, and delete all instances of the class DerivedC, how would I do that? [CODE] class Base; class …

Member Avatar for VBNick
0
231
Member Avatar for Labdabeta
Member Avatar for Labdabeta
0
433
Member Avatar for visom

Hi, I'm making a code that calculates the number of days between two dates. If you punch in 1 for month and 5 for days, and you punch in 2 for month and 1 for day, it should say "27 days between these two dates". Right now the problem I …

Member Avatar for Despairy
0
119
Member Avatar for pd2001

hello everyone, i am trying to read a unformatted text file using ifstream. i want to read the lines..i have done by using getline. but my text file format looks like firstname:abd lastname:cbd user name is abd cbd age is 45 height is 66cms I was able to read line …

Member Avatar for Despairy
0
123
Member Avatar for margeaux54

ı have a question. I know which data type and its specifiers . but ı do not know that for example "int" data type how many number takes or long integer how many number takes. ı calculated their bytes but still ı do not know when ı choose them. again …

Member Avatar for Fbody
0
169
Member Avatar for Khoanyneosr

[code] 1>------ Build started: Project: DirectXtutrials, Configuration: Debug Win32 ------ 1>Build started 3/24/2011 5:24:05 PM. 1>InitializeBuildStatus: 1> Touching "Debug\DirectXtutrials.unsuccessfulbuild". 1>ClCompile: 1> main.cpp 1>ManifestResourceCompile: 1> All outputs are up-to-date. 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 1>C:\Users\Konnor\Documents\Visual Studio 2010\Projects\DirectXtutrials\Debug\DirectXtutrials.exe : fatal error LNK1120: 1 unresolved externals …

Member Avatar for Khoanyneosr
0
270
Member Avatar for Despairy

we just started studying about linked lists and i wrote a simple code to build up a link list. than post the sum of all the numbers inside the list my problem is that i need to delete all even numbers and i cant figure out what is wrong with …

Member Avatar for Despairy
0
4K
Member Avatar for rp45

Hello, I just joined this web site and i'm new to programming and i'm stuck on this program, can't seem to finish it, after couple of days of trying to figure this program out, i realize i need help. The program is pretty much done i just don't know where …

Member Avatar for VernonDozier
0
92
Member Avatar for a.muqeet khan

guys i made a program and it is working the prob is that it is not displaying the values to in float so guys plz help me in this regard #include "stdafx.h" #include<iostream> #include <stdio.h> using namespace std ; void reduce(int&,int&); class decimal { int numerater; int denominater; public : …

Member Avatar for VernonDozier
0
188
Member Avatar for HASHMI007

[CODE]/* I made point class it has two objct x,y. i made saparate function for giving values to x & y object but when i run the it provide wrong answer. i enter firstValue=5 , secondVaue=6. the program shoul provide same answer same as like(5,6) but result show after excuting …

Member Avatar for HASHMI007
0
109
Member Avatar for v_janssens

I have a class Matrix2D where the matrix is defined as vector<double> elements. I'm trying to use the function Gauss() to perform gaussian elimination on a matrix a [CODE]bool Gauss(Matrix2D& a) { [INDENT][/INDENT]//Gaussian elimination routine }[/CODE] The function itselt works perfectly and if I view the matrix a just before …

Member Avatar for v_janssens
0
161
Member Avatar for mclemon

Hi there! I'm writing a program which has lots of vectors in it...I've named these vectors sequentially - ie vector1, vector2, vector3 etc. What I was wondering is, is there a way of displaying the contents of these vectors without manually writing cout << vector1[0] etc? I know this doesn't …

Member Avatar for vijayan121
0
100
Member Avatar for Derek Elensar

Okay, so I have said code: [code] #include <iostream> #include <cstdlib> using std::cout; using std::cin; using std::endl; int main() { char input[8]; int counter = 0; int newletter; do { cout << "Please enter a 7 letter word to encrypt:\n>"; cin >> input; if(input[8] != '\0') { input[8] = '\0'; …

Member Avatar for Derek Elensar
0
178
Member Avatar for duliduli556

Hi Guys I am trying to read contents of directory... using "FindNextFile(hFind, &FindFileData)" Findfirstfile returned me then first file in the directory.. even though I have somany files in the directory (FindNextFile(hFind, &FindFileData) returning me zero..... can anyone help me... thanks in advance... Thanks

Member Avatar for tkud
0
62
Member Avatar for Voidz

Hi, what's #pragma and #pragma once? I can't find website's that explain it for a noob, as I am a noob. I think it's related to #ifdef? I also think I know what #ifdef is. It's when you want to see if something is defined. Like #ifdef WIN32 #endif. Thanks.

Member Avatar for gerard4143
0
72
Member Avatar for littleleaf

Hey guys, I am writing a C++ program with the help of dynamic allocation of a character array. The size of the array depends on the size of file read. However, when I checked the size of allocated array, it is always 4! So, is there any limit on this …

Member Avatar for jonsca
0
170
Member Avatar for benchz23

i forgot to put DO in my program. since i was instructed to use DO-WHILE LOOP. i still have the same output if i use this code. But better to have the DO inserted. output: 0 0 2 0 2 4 0 2 4 6 0 2 4 6 8 …

Member Avatar for daviddoria
0
163
Member Avatar for duliduli556

hi, could anyone please point me towards a good link or post a code that helps explain how these could be implemented? thanks a lot

Member Avatar for jonsca
0
78
Member Avatar for benchz23

i need to make a program that would display the figure as shown below. using a DO-WHILE structure and a method to implement the task. a C++ program. output: 0 0 2 0 2 4 0 2 4 6 0 2 4 6 8 0 2 4 6 8 10 …

Member Avatar for Fbody
0
170
Member Avatar for schrope

I need help i am not sure if i am on the right track. i have to write a program to calculate the night of nights someone has to stay and what size bed they want. than i have to give a total of cost plus 6% sales tax. her …

Member Avatar for txwooley
0
308
Member Avatar for spixy

I have a problem on programming, its not really my assignment, but my friends... i just thought i can resolve this at C, because i got some backgrounds on it.. but i can't do it my compiler is dev c++ the code must be on C++ not C can i …

Member Avatar for spixy
0
2K
Member Avatar for dospy

recently i understood at last how can i store more values in an int with bytwise operators, also, i have read that #define directives are evil for a number of reasons. one of them: [CODE] #define SEVEN 2 + 5 int result = SEVEN * 5; cout << result; // …

Member Avatar for dospy
0
170
Member Avatar for cyman29

Hey this is from my c++ assignment at Uni. I'm fairly new to programming so i need some help. The program has separate functions after the main() which i have to call everytime i need to use them. So I've sorted an array using a fuction with an algorithm of …

Member Avatar for mike_2000_17
0
188
Member Avatar for visom

Hi, I'm making a program that finds the number of days between two dates (so far you can only put in 1 date because my code is incomplete). The code is incomplete right now but my problem is that the problem is that my code doesn't return a needed value. …

Member Avatar for visom
0
103
Member Avatar for xyzt

Hi all I'm designing a multithreaded application which has long running threads. I need to check some condititons in the main thread, interrupt the threads and end the program if the conditions are true. But i'm not sure if this is the correct/safest way. Here's my pseudo: [CODE]main() { boost::thread …

Member Avatar for thekashyap
0
172
Member Avatar for ashrafu1

hello am making a library program that add, delete and shows record. i am done with it. but now i have a logical problem. the id i input for a book it can be taken by other books. i need to restrict ID for one book which cannot be used …

Member Avatar for griswolf
0
277
Member Avatar for sosongetsu

Its been a little while since i have used Dani Web but i need some help. If the code looks a little off then you have to forgive me. I was getting help from a friend who i found knew less about it then me. Here is the criteria for …

Member Avatar for Chilton
0
171
Member Avatar for sdr001

Hello, I am getting a segmentation fault in my program and do not know why. It occurs when the program reaches: [CODE]for(i=0; i < values.size();i++) items[i].value += values[i];[/CODE] Values have integers inside of it (7,77,2,3). Items is a vector<knapSackStuff> items; and my knapSackStuff look like: [CODE] struct knapSackStuff { int …

Member Avatar for template<>
0
88

The End.