49,761 Topics

Member Avatar for
Member Avatar for StuartB2

Hi there, im trying to create a quiz program in c++. I need to have an array within a struct as i need to store a question title, ten possible answers and the points that each answer is associated with any help about how to go around declaring this would …

Member Avatar for Nick Evan
0
193
Member Avatar for ben25x

hey this is a just for fun topic (a.k.a. NOT homework) but if you can please reply: I am working in Visual C++ and I can't get any <iostream> operation to write a single character to a variable and then check it in an if() statement. Here is my last …

Member Avatar for Nick Evan
0
208
Member Avatar for sdinu96

Hi everyone, I want to write a code in C++ so i want to knw information about /proc in liux . where if we give the command "top" in terminal it will show all currently running information like this if i want to display these information using C++ code .so …

Member Avatar for Nick Evan
0
57
Member Avatar for moni94

Hi. I have this very weird problem. The function getOps in the code below always returns 0, although it should be returning the ops value which gets calculated correctly. [CODE] int ops; int getOps(int n, int m) { if(m == n) return ops; else if(m - 2 <= n) return …

Member Avatar for moni94
0
200
Member Avatar for Mona..

Hi.. I want to write a C++ program which reads a text from the user and change any uppercase letter to an lowercase letter and assign them to an stack?? please help..

Member Avatar for Narue
0
201
Member Avatar for effizy

Any suggestions on open source project i can contribute to or begin on my own? Nothing complicated - am just a beginner and would like to improve my knowledge.

Member Avatar for daviddoria
0
257
Member Avatar for Peram

I already know how to use fstream. I know to save the value variables to a file, and I also know how to make the program display the information in the file, but my problem is that it saves the content of the variable, not the variable itself. Here's what …

Member Avatar for Peram
0
231
Member Avatar for FutureWebDev

The program takes 10 numbers of type float, which are entered by the user, and outputs the average ( also of type float ) of those 10 numbers. If I am going to test a range of values for those ten number, am I correct to test the highest values …

Member Avatar for FutureWebDev
0
185
Member Avatar for Awah Mohamed

hey people , i am a c++ biginner , i am self tought , this mean i have no teacher to help me . now i arrived to graphics . but i have got a small problem , i am programming with my laptop. my laptop is a mini laptop …

Member Avatar for Basteon
0
332
Member Avatar for Marissak

Hi everyone. I am trying to write a recursive maze program. I have the program without the recursion but I am having a hard time putting the recursion in there. This is the regular code: [CODE]#include <iostream> #include <string> #include <stack> using namespace std; template<class T> class Stack : public …

Member Avatar for Marissak
0
199
Member Avatar for benny2010

Hello does anybody know how to scale a sprite or image to fit the whole render window? at the moment i have my checkers board but its in one corner of the window and i want it to fit the window entirely would be a great help :)

Member Avatar for myk45
0
187
Member Avatar for chamika.deshan

Hello I am in a difficulty in finding the size of array. In following program I am passing the arraysize and the array as a parameters. Instead of doing that can I find the array size in the method? [CODE]template <class T, typename ReturnType = float> class TEnterImp { public: …

Member Avatar for chamika.deshan
0
107
Member Avatar for rj2910

object for test class can be created as test t=50; // y so..how can integer be equal to object?? // don't we need to call any constructor here or is it some trick of visual studio??...and if it is then how is it possible?? class test { public : int …

Member Avatar for mrnutty
0
101
Member Avatar for hao90

Can anyone teach me how to assign a empty array to zero? Which means that some of the c[x][y] have not assigned to a value. [CODE]int x = 4; int y = 4; a[x] = {30,40,50,60}; b[y] = {100,20,60,40}; c[x][y]; int i = 0; int j = 0; while(i<x && …

Member Avatar for hao90
0
101
Member Avatar for modjoe

Ok, so i have an assignment due in 9 hours, its about computing the shortest paths from a vertix input by the user to all other vertices. The adjacency matrix is supplied from a text file, so I have done the following code: (Some of it was given for me …

Member Avatar for daviddoria
0
508
Member Avatar for mpike

ok so theres 2 things i need help with. in my code i have a random dynamic array with sides a minimum of 9 and max of 20. in this array i need to spawn characters randomly (here's where i need help) how can i randomly spawn characters in a …

Member Avatar for Dingbats
0
404
Member Avatar for Theanonymous

Hi I have to implement this code parts [URL="http://www.daniweb.com/forums/attachment.php?attachmentid=18567&stc=1&d=1292681569"]first code[/URL] [URL="http://www.daniweb.com/forums/attachment.php?attachmentid=18568&stc=1&d=1292681569"] second code[/URL] [URL="http://www.daniweb.com/forums/attachment.php?attachmentid=18569&stc=1&d=1292681569"]third code[/URL] at my code for linkedbinary tree [CODE]#include <iostream> using namespace std; template <typename Object> class LinkedBinaryTree { protected: struct Node { Object element; Node* parent; Node* left; Node* right; Node() : element(Object()) { parent = …

0
79
Member Avatar for CrazyPixel

Hello. First of all, I'd like to say that this is my first post. I have indeed searched this forum for code snippets and help, but never thought I'd have to post anything, since I could easily search for someone who's had the same problem and fix my own code. …

Member Avatar for jonsca
0
167
Member Avatar for MarounMaroun

Hello folks, How can I fill a 2D-array (of size [1260][4]) with all variations of 1-10 (which is 5040 variations)? 1 2 3 4 1 2 3 5 1 2 3 6 .. .. 1 7 4 9 .. and so on.. Thanks!

Member Avatar for frogboy77
0
94
Member Avatar for localp

I need to code a C++ program to execute the tab control of the keyboard through the code. I am expecting when the tab control of the code gets executed, we should be able to navigate throught the web page through it. for example, take a web page, and we …

Member Avatar for localp
0
304
Member Avatar for amit_tare1

hello, I am Amit tare (India) currently i am working with the C++ server. which having the facilities of:: run on all the platforms(Operating systems), memory management, thread safety, and handlers.... pooling features...... I am using VC++ IDE on Windows platform.... [B]please help me to build the core features of …

Member Avatar for seanbp
-1
144
Member Avatar for bookmark

Hi I have this code with a function that outputs a square filled with the given char but for the [CODE] square(4);[/CODE] I want it to just output a square like this [CODE] **** **** **** **** [/CODE] How would I do this without changing the function definition or using …

Member Avatar for MasterGberry
0
126
Member Avatar for lochnessmonster

How would i read a files bytes into a buffer in my program to compare them with another string a bytes? what methods are possible that i have available using c++ standard and/or the windows api -thx

Member Avatar for jonsca
0
82
Member Avatar for bookmark

Hi. This program has a function that divides an unsigned arg by another unsigned arg. I want it to only keep outputting "I'm really upset" after the first time it outputs "I'm really upset". Right now it outputs as [CODE] 5 0 I'm really upset 6 Press any key to …

Member Avatar for jonsca
0
123
Member Avatar for kuksa1994
Member Avatar for seanbp
0
50
Member Avatar for bookmark

Hi I'm trying to make a program that returns the number of letters in a string but it seems that the function I have is not working as it returns 0 every time. Can someone check what I'm doing wrong? Thanks in advanced. [CODE]#include<iostream> #include<string> using namespace std; unsigned letters(const …

Member Avatar for bookmark
0
257
Member Avatar for bookmark

Hi, I have this program that outputs a triangle when given the size. Right now the triangle outputs like this [CODE] 5 * ** *** **** ***** [/CODE] Does anyone know how I would make it look like this? [CODE] 5 1 12 123 1234 12345 [/CODE] Thanks in advanced …

Member Avatar for bookmark
0
213
Member Avatar for steve_Student

Hi i have created a program for my college assignment which asks to create a program for a telephone company that requires the program to calculate call charges for their customers, and also give discount calls depending on the time of day and day of the week. The assignment also …

Member Avatar for sakijr
0
186
Member Avatar for seanbp

These days, it's usually unnecessary to consider how much memory to allocate for a string input. This was mostly for fun. This code allocates memory as the user inputs each key stroke, then allocates and returns a string pointer when the user presses enter. Tell me what you think! [B]USAGE:[/B] …

0
329
Member Avatar for by_stander

Hey everyone, I have a Matlab code that parses data from a csv file, performs some calculations on the data, and spits it back out into a new csv file. the new csv file contains all the data from the original file, with the new calculations appended on at the …

Member Avatar for jonsca
0
232

The End.