49,757 Topics

Member Avatar for
Member Avatar for svatstika

Hi everybody! I'm working on a following program: [CODE] #include "stdafx.h" #include <iostream> using namespace std; class char_queue { protected: struct charList { public: char val; charList* next; charList(char ch, charList* ptr) { val = ch; next = ptr; } }; protected: charList* begin; charList* end; void clearCharList(); public: char_queue(); …

Member Avatar for jonsca
0
153
Member Avatar for Tsunami49

Hi there. I am creating a mock up of a physics library currently, and I am currently trying to deal with 2d arrays. Right now I am having issues with transposing the array. here is the code with the messy stuff cut out [CODE] //TMatrix.h #pragma once #include "main.h" class …

Member Avatar for Tsunami49
0
107
Member Avatar for qvyhnl

hi, can someone help me started with how to write a program that remove the comments from an input cpp file? I am not even sure how to declare the function, like what would be the parameters? and if I use ifstream file; file.open("text.cpp") will the program treat that as …

Member Avatar for geojia
0
184
Member Avatar for ChristinaS

Hi! I'm trying to find min variance (both value [U]and[/U] index). I have x# of product defects tracked over y# of days. prod1 prod2 prod3... Day1: 1 1 1 Day2: 1 2 2 I have arrays that store max & min defects, by product#. minVar = maxDefect[]-minDefect[] gives me the …

Member Avatar for ChristinaS
0
189
Member Avatar for dvspinay

Here is my initial code. It is linking, but giving me an error code that I can't comprehend. I have to basically write a program to do the following: In main declare a Player Name array and a score array. Declare the size of the arrays to be 100. In …

Member Avatar for Ancient Dragon
0
166
Member Avatar for geryin

This was part of a questionnaire. I have no idea what they are asking... my closest guess is float rational please help! thank you.

Member Avatar for Ancient Dragon
0
144
Member Avatar for burcin erek

I made a simple color finding game. the problem is that my color input guess is not good so complex I want them in one line and also I want to see my tries at certain places. can you help me thanks in advance. [CODE]#include <cstdlib> #include <iostream> #include <string> …

Member Avatar for mrnutty
0
135
Member Avatar for KLane

I have written the program below to calculate Standard deviation and mean of a given file of data. If I run it gives the wrong answers. Can someone help me go along? #include <cstdlib> #include <iostream> #include <cmath> #include <fstream> using namespace std; class Statistics{ double x; int n; double …

Member Avatar for mrnutty
0
115
Member Avatar for vbx_wx

[code] void* thread(void* arg) { std::cout << "Hi" << std::endl; return arg; } void clientFunc(TCPSocket* s) { pthread_t pid; pthread_create(&pid, NULL, &thread, NULL); pthread_join(pid, NULL); } int main() { ServerSocket s(4543); try { while(1) { clientFunc(s.accept()); } }catch(Error& err) { err.what(); } } [/code] My question is, how can I …

Member Avatar for daviddoria
0
105
Member Avatar for tech9x

here is my code [code=c++] int main() { int i; char * cstr; char * p; string *userInput; int sizeOfArray; cin >> sizeOfArray; add(i,userInput,sizeOfArray); system("PAUSE"); } void add(int i, string *userInput, int sizeOfArray) { string Input; char * cstr; char * p; userInput = new string [sizeOfArray]; for(i= 0; i< …

Member Avatar for Zjarek
0
278
Member Avatar for YahRioO

hi Using while, write a program that keeps reading integers from user until he enters -1 then prints the average of all entered numbers (-1 should be ignored). this is my solution, but i dont know why he gives me wrong average? [CODE]#include<iostream> using namespace std; void main() { double …

Member Avatar for Clinton Portis
0
225
Member Avatar for KLane

Someone Please help with this. I want to make a class Statistics and read from an external file and find the mean and standard deviation and below is what i have so far. any suggestions? [code] #include <cstdlib> #include <iostream> #include <cmath> #include <fstream> using namespace std; class Statistics{ double …

Member Avatar for daviddoria
0
95
Member Avatar for Rez11

Palindrome detector. Palindrome is any word/sentence/phrase that reads the same foreword and back. I'm in the middle of creating a program that accepts a sentence, phrase, or word. Then checks to see if it's a palindrome, I'm just having trouble on what to pass to my function. The function must …

Member Avatar for Rez11
0
126
Member Avatar for svatstika

Hello everybody! I'm trying to understand following code. [CODE] #include "stdafx.h" #include <iostream> using namespace std; class Circle; class Square; class Triangle; class Shape { public: virtual bool Check(const Shape&)const = 0; virtual bool Check(const Circle&)const = 0; virtual bool Check(const Square&)const = 0; virtual bool Check(const Triangle&)const = 0; …

Member Avatar for Ancient Dragon
0
262
Member Avatar for stark025

Hello all, I've recently been asked to demonstrate the difference between Turbo C++ 3.0 and Visual C++ 2008. I'm not really familiar with the current coding standards, so I've enclosed a sample of Turbo C++ code. Please point out which functions are deprecated as well as their replacements. [CODE="C++"]#include <iostream.h> …

Member Avatar for stark025
0
257
Member Avatar for tawes01

I have a dialog-based application that just has a big edit box. I want to make a quotation mark bold right when it is typed. How can this be done? I am using dev-c++ 4.9.9.2 (I don't know how to make single characters bold, let alone how to capture the …

Member Avatar for Ancient Dragon
0
143
Member Avatar for frogboy77

Can anyone tell me how to find the maximum value for a specific variable(i.e int, long long int, double)? Also is there a way to set a variable to this value(without knowing it and typing it in)? Using Dev C++. Any help appreciated.:)

Member Avatar for frogboy77
0
85
Member Avatar for logicslab

Hi Friends, I am new to C++ wxwidgets world . I plan to study same, I am basically from web programming but I like to study this new technology come in C++(I am newbie there too!). I have 2 types of C++ distributions installed in my PC with Windows XP …

Member Avatar for SgtMe
0
258
Member Avatar for waleed.makarem

Dear All , I need your support to convert the below C++ 6 lines code to C# or vb.net . this function calculates the checksum for a given text. GUCHAR GenerateCkSum(GUCHAR *pure_data, U2 size) { GUCHAR chksum; I2 i; chksum = pure_data[0]; for(i=1; i<size ; i++) chksum ^= pure_data[i]; return …

0
84
Member Avatar for MissaDev

Hi I'm New Here. Although I have been reading in the past and appreciate all the help that the board has given me already. I have a homework assignment that I need the user to enter how many names they want to enter, then enter that number of names, display …

Member Avatar for mitrmkar
0
130
Member Avatar for sunny120786

hello, I want to write 2 programs with C , one work on Robot1, the other work on Robot2. So I want the program to send a signal from Robot1 via Bluetooth to Robot2 and Robot2 handles and accepts this signal (message)and reply to Robot1. how to code this? please …

Member Avatar for daviddoria
0
256
Member Avatar for thestrokes

Hi.. I don't know how to do the draw condition & error checking on the following tic tac toe codes, can anyone help me to complete this with elaborations and explanations please.. thanks #include<iostream> using namespace std; char box[9]={'1','2','3','4','5','6','7','8','9'}; void drawboard() { cout<< box[0]<<" | "<<box[1]<<" | "<<box[2]<<endl; cout<< "---------"<<endl; …

Member Avatar for daviddoria
0
994
Member Avatar for muze

hello guys... when we press F12 in visual studion envirnoment, it takes us to the definition of the function (and Shift+F12 to declaration) but what is the hotkey for going back where we were (I mean back to the usage of function where we pressed F12)?? thnx

Member Avatar for daviddoria
0
77
Member Avatar for cwarn23

Hi, I have been working on a way to reverse bitwise Xand with c++. I have managed to do most of it but can anybody tweak this script I made so it works to its full potential. At the moment this script tries to return the variable x from ((12 …

Member Avatar for cwarn23
0
107
Member Avatar for tech9x

[code=c++]void getCommands(char * cstr,char * p,string *userInput,string Input) { string currentCommand = ""; strcpy (cstr, userInput.c_str()); p = strtok (cstr," "); while (p!=NULL) { p=strtok(NULL," "); cout << p; } [/code] ERROR `c_str' has not been declared request for member of non-aggregate type before '(' token I have #include <cstring> …

Member Avatar for jonsca
0
323
Member Avatar for muze

hello guys...Due to some reasons I need to pass a variable's address to MeessageBox(). I am using a function which returns a pointer to the item selected from combo box. Now I want to show this item's name in the MesageBox(). How can I do that? thnx``````

Member Avatar for muze
0
81
Member Avatar for mybluehair

I'm trying to say this: [CODE] string songLocation = "data/sounds/blabla.wav"; PlaySound(songLocation,NULL,SND_FILENAME|SND_ASYNC);[/CODE] but here is the error I get: [CODE]cannot convert `std::string' to `const CHAR*' for argument `1' to `BOOL PlaySoundA(const CHAR*, void*, DWORD)' [/CODE] Does anyone have any ideas? (btw, songLocation cannot be changed from a string. If that happens …

Member Avatar for geojia
0
127
Member Avatar for Glapsides

Hello people, Quick question. I am working on a mouse maze project, and I need help reading the maze into a dynamically created multi-dimensional array, called "maze". I have already implemented a working code as long as the type of "maze" is char. Below is the code for that: [CODE]bool …

Member Avatar for Glapsides
-4
116
Member Avatar for spooder weld

I'll try to keep this short. I'm writing a 2D platforming engine and I had good collision detection, but I had to add a separate condition for every platform I had. Essentially the collision function compares the sides of 2 rects. Here is a code snippet of the for loop …

Member Avatar for spooder weld
0
364
Member Avatar for mybluehair

I've got a chunk of code that opens up a txt file with 5 or 6 lines inside. I only need to grab the first line of the txt file and put it inside of a variable. The problem is that when I use this code, instead of grabbing the …

Member Avatar for Duoas
0
421

The End.