49,761 Topics

Member Avatar for
Member Avatar for whodoes21

Hello citizen of Daniweb may I ask a little help from you guys please :) see there's this program that our professor had asked us to make and It's about pointers. as a newbie to this world I was able to (gladly) make it but i feel like it could …

Member Avatar for whodoes21
0
195
Member Avatar for daviddoria

I have this: [code] int serialInt = 40000359; [/code] but what I really need is this: [code] int serialHex = (int)0x40000359; [/code] What can I do to turn serialInt into serialHex? I found some code that claimed to do this: [code] int IntToHex(int input) { std::stringstream ss; for (int i=2*sizeof(int) …

Member Avatar for daviddoria
0
171
Member Avatar for svatstika

Hello everyone! I'm trying to understand the following code: [CODE]class char_queue { protected: struct charNode { public: char val; charNode* next; charNode(char ch, charList* ptr) { val = ch; next = ptr; } }; protected: charNode* begin; charNode* end; void clearCharNode(); public: char_queue(); bool find(char ch); virtual void add(char ch); …

Member Avatar for svatstika
0
124
Member Avatar for Martje

hey guys, I am using windows textbox (CLR) and i was wondering how i would replace a newline to a text. I know how to replace words, i use : textBox1->Text->Replace("first","second")); but how would i replace a new line? lets say my textbox looks like this : [QUOTE] test1 test2[/QUOTE] …

Member Avatar for Ancient Dragon
0
102
Member Avatar for tech9x

[code=c++] int i; string *opening; string *ending; int *num1, *num2, *num3, *num4, *num5, *num6; char chr, chr1, chr2, chr3; for(i= 0; i< sizeOfArray; i++) { getline(cin,opening[i]); cin >> num1[i] >> chr >> num2[i] >> num3[i] >> chr1 >> num4[i] >> chr2 >> num5[i] >> chr3 >> num6[i]; getline(cin,ending[i]); } [/code] …

Member Avatar for jonsca
0
151
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
247
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
258
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
109
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
326

The End.