49,761 Topics
| |
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. … | |
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 … | |
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 … | |
Quick question (hopefully), how do I save an SDL_Surface image to a file? | |
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 … | |
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 … | |
ı 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 … | |
[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 … | |
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 … | |
| 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 … |
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 : … | |
| [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 … |
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 … | |
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 … | |
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'; … | |
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 | |
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. | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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; // … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.