49,761 Topics
| |
i have an assignment due for my c++ class where we have to input from the keyboard the quantity and input from the keyboard the stock price. so that it outputs as: Stock Item Quantity Unit Price Total Value ---------------------------------------------- Television 5 368.00 1840.00 Video Recorder 8 268.00 2144.00 Camera … | |
how to move all elements in array random in c++ | |
can anyone tell me why the timer doesn't work in my code? The game runs good but there is no timer? [CODE]//---------------- includes ---------------- #include "global.h" #include "SDL.h" #include <string> #include <cstdlib> #include <windows.h> #include <mmsystem.h> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <conio.h> #pragma comment(lib, "winmm.lib") using namespace std; … | |
Hello everybody! I need to move the get pointer of a text file at the beginning so i wrote in my program the following line (knowing that in a binary file really works): [code=c]ifstream in; in.open("data.txt", ios::in); in.seekg(0, ios_base::beg); [/code] but...in my text file doesn't really work. Is there a … | |
Hi this is my problem Define a class Circle that stores the center and radius of a circle, by keeping the numbers in a dynamically allocated array of doubles. Supply the "big three" memory management functions. Use this class to demonstrate (a) the difference between initialization Circle s; Circle t … | |
pls help me with this one..everything is ok but when i add student and faculty number and then try to list them says "No added students'...:@ This is: main.cpp [code] #include <iostream> #include "Student.h" #include "Course.h" using namespace std; list<CStudent*> students; list<CCourse*> courses; CCourse* findCourse(string name) { CCourse* course = … | |
Hi, I need to make a pairs between array elements. For eg if the sored array I have is [CODE]1 1 1 2 1 4 1 6 2 3 2 5 2 8 2 9 3 7 3 10[/CODE] then I need to pair every element of the 2nd column … | |
I creating a 2d computer game, and I want to put enemies that in that appear at random coordinates. The problem is i'm not sure entirely how to do it. I have the "enemy" in a array of 30,and then i want to put these 30 enemies on a map, … | |
I believe that ofstream is for writing into a file and ifstream is for reading from a file. I am trying to write into a file by taking commandline input from the user which is the accept_data() function and and then display all the data from the file that the … | |
I'm trying to just use a normal stack and have it pop the numbers in the order stacks normally go but it just keeps popping 28 (or at least from output thats what i see) it should just be pretty straight forward but .... [CODE] #include <iostream> #include <stack> using … | |
hi guys!! i am wrting a program for a small arithemtic game,it displays two numbers and ask user to enter the sum of these two numbers,the program runs fine but i want to add a countdown timer,i mean time limit for user to answer all 10 questions within 30 seconds.i … | |
It is posible in a linked list implementation,the nod to hold more then one information ? for exemplei want the node to hold a person`s name,adress,country,etc.... | |
Hi, I would need to create unique filenames appended by the iteration number. For eg. [CODE]for( i=0;i<iterations;i++){ ofstream outfile("iterfile"+"i"); // i.e filename should be iterfile0 for 1st iteration. } [/CODE] I need to cast "i" from int to char so I tried [CODE]ofstream outfile("iterfile"+(char)i)[/CODE] but it did not work. How … | |
Hello, I have a question: [CODE] Algorithm DFS(Vertex V) mark[V] := 1; print[V]; for each (edge (V, W)) do if mark[W] = 0; DFS(W); [/CODE] I would like to realize this recursive procedure (depth-first search), but in my graph representation (with adjacency lists) I use two different classes, one for … | |
I am in the process of updating and modifying source code for an existing application that runs on Linux systems. As part of my modifications, I will be needing to use the library function unlink() from unistd.h However, the class that I need to modify, has an existing public member … | |
Hello! I need to check packet sender from some port and separate packet if the sender is not trusted how get info about packet sender.... ? please help... | |
I have downloaded the trial package and am trying to update an old project developed on VC++ 2002. The old environment will not develop an executable to run on W7. The VC++ 2010 generated an upgrade, compiled, linked and lists just a single error MSB3061 which is labeled "unable to … | |
hi i need a urgent help for a program that i cant make and this is : Write a program that implements a game, to teach arithmetic to little children. The program tests addition and subtraction. In level 1 it tests only addition of numbers less than 10 whose sum … | |
Hello !! i need to write some program on the windows that block incoming connection from any Ip from some ports (for example 21 or 25) and allow to connect Ip that are in white list ! and always when coming new connection from ports, the program must check the … | |
Hello Good people,am not so sure if this should go here,i am student who is interested in developing a search engine that indexes pages from my country.I have been doing my research on Algorithm to use for sometime now and i have found HITS and PageRank as the best out … | |
I am trying to convert a piece of code into Delphi but fall down when it comes to this example : [CODE] void __stdcall GetBuffers( short **xBuffers, unsigned long nValues) { ....... memcpy(TargetA, xBuffers[0], nValues * sizeof(short)); memcpy(TargetB, xBuffers[1], nValues * sizeof(short)); memcpy(TargetC, xBuffers[3], nValues * sizeof(short)); memcpy(Targetd, xBuffers[4], nValues … | |
Hi guys, Here's my project finally. It's name is C.L.O.S.E - The Command Line Open Source Editor Please review and comment. Mention errors if any, Also, for this code to work. Please download open.cpp, find.cpp, new.cpp, append.cpp, compile them and place all of them including the main source in a … | |
I am trying to use the playsound function i have the code [CODE] PlaySound(L"C:\Documents and Settings\Louisa\My Documents\Visual Studio 2010\Projects\Ninja_Wars\Ninja_Wars\music.wav",NULL,SND_FILENAME|SND_ASYNC | SND_LOOP); Sint32 delta;[/CODE] But when i play the game all i hear is a beeping sound- the one windows has when there is an error or something. Can anyone help … | |
Hi, I've to send a string using serial communication. I've tried to use WriteFile function but maybe I wrong something, because I cannot send my data. I hope someone can help me! Tnx everybody Bye Alex | |
Okay, like my other thread says, I'm working on a game engine. A couple if minutes ago, I compiled, and it ran perfectly. Now, when I compile it, I don't even see a DOS prompt or anything. I'm really confused, can someone help me and tell me what I did … | |
Hey guys, I've recently started learning WinAPI and I want to make a Tic Tac Toe game with it but I have a problem I have a main window ("field") and 9 child windows ("tiles") and I want to make the tiles clickable so that a click calls the Beep() … | |
can any one suggest me solution please [CODE]//CAtlString str=(_T(buffer)); //buffer wil have{{ ( ab != cd } == true }} as my input CString str=(_T(buffer)); CString symb[10]={ "{{","}}","==","<=",">=","!=" , "true", "flase", '(', ')' }; (LPCTSTR)str.trim(_T(symb));[/CODE] if i am trying to execute this code iam getting some errors like 1>d:\c++_test_code\simple\simple\simpledlg.cpp(197) : … | |
Hello Daniweb, I am writing a game engine in C++ with SDL, and am faced with a problem. I need to store the sprite animation coordinates for every different animation in a different array. The problem I am facing is, since I am putting the arrays in one single Player … | |
Its this side thing I was working one, when I got the chance. Its not very good right now, as its still in its developing stage. But its still ok, where I can show it of, lol. Attached is an exe, that given a set of data points, it tries … | |
Hi folks, Can someone tell me what is the meaning of this line? and how to use this command properly? [CODE] Lock::~Lock() { DEBUG('t', "Deleting lock \"%s\"\n", name); [/CODE] Thanks |
The End.