49,761 Topics

Member Avatar for
Member Avatar for Swiftle

Hi, I'm doing a client/server with threads instead of forks. The goal is to have multiple clients connect to the server and for each client the server makes a new thread. Although it's working atm, there are things that bother me, especially the sockets. The first thing I want to …

0
56
Member Avatar for <Tech>

Hey, I'm going to college to major in computer programming. Will what I learn in college, in any way, help me to write my own programming language and make my own compiler? If not, where could I acquire the information?

Member Avatar for gerard4143
0
82
Member Avatar for plang007

Here is my code: #include <fstream> #include <iomanip> #include <cmath> using namespace std; int main() { char fare; char choice='Y'; int hrIn, minIn, hrOut, minOut; int hours; int minutes; int total_minutes; double cost; float charge; float additionalTime; while(choice=='Y'||choice=='y') { cout << "\nThis program will calculate a single, couple, or group …

Member Avatar for Software guy
0
188
Member Avatar for jember

I need immediate help here. Please help me! :) I just can't figure out why my program is crashing while executing it. The compiling of the program is fine. (no syntax errors) I used Dev C++ 4.9 for this version. [QUOTE][CODE] #include <iostream> #include <conio.h> #include <iomanip> #include <string> using …

Member Avatar for jember
0
156
Member Avatar for lexusdominus

i would never ask for debugging help usually but i am totally lost and have wasted far too much time on this. both peices of code compile correctly. the original function works fine with my program and the second one crashes. the original code checks a textfile in the root …

Member Avatar for lexusdominus
0
315
Member Avatar for fpsasm

Hello, I am writing a section of c++. Here is the section that does not work: [code=c] int a, escape; double temp1,temp2; escape = 0; a = 0; while(escape < 2){ Complex c[a]; cout << "Please input a complex number, the real part follwed by the imaginary part.\n"; if(!(cin >> …

Member Avatar for fpsasm
0
111
Member Avatar for blee93

Hi, I wrote this code for C++ Primer Plus, but I don't really get why it doesn't work. [CODE]#include <iostream> #include <cctype> using namespace std; int main() { char ch; string str; int vowels = 0; int consonants = 0; int others = 0; cout << "Enter words (q to …

Member Avatar for Red Goose
0
223
Member Avatar for holocron

Greetings all DaniWeb people, long time no see. I have a (hopefully) easy question. Let's jump into the code. My test harness: [CODE] cout << "--------------------------------------------------------" << endl; cout << "Begin Copy Constructor Testing" << endl; cout << "--------------------------------------------------------" << endl << endl; dlSL = new DLSortedList(); for (int i …

Member Avatar for holocron
0
230
Member Avatar for LevyDee

Are static variables allocated in the heap or on a thread specific stack. Thanks

Member Avatar for LevyDee
0
74
Member Avatar for dimProg

Hello, I'm new to c++ and we're just starting classes and objects in class. I've done a bit of programming in Java and I'm struggling to initialize an object using a variable. I must be missing something fundamental but I can't for the life of me figure it out. Here's …

Member Avatar for rickster11
0
1K
Member Avatar for Jessurider
Member Avatar for Sundayy

[B]I'm new to C++ and I need help in writing code:[/B] Lucy likes to jog in the morning. As she jogs, she counts the number of strides, she makes during the first minute and then again during the last minute of her jogging. She then averages these two numbers together …

Member Avatar for Sundayy
0
165
Member Avatar for KHALIL ASLAM

QUESTION? (TIME TABLE) YOU ARE THE OWNER OF A RAILWAY SYSTEM BETWEEN n CITIES, NUMBERED BY INTEGERS FROM 1 TO n. EACH TRAIN TRAVELS FROM THE START STATION TO THE END STATION ACCORDING TO A VERY SPECIFIC TIMETABLE (ALWAYS ON TIME), NOT STOPPING ANYWHERE BETWEEN. ON EACH STATION A DEPARTURE …

Member Avatar for jonsca
-2
135
Member Avatar for medopunsher

Hello , The following function takes a number x and returns the sum of all numbers before n. For ex. when x = 5 the function should return 4+3+2+1. [CODE] unsigned long long rep(int x) { if(x==1)return 1; return x + (rep(x-1)%314159); } [/CODE] I'm getting a segmentation fault with …

Member Avatar for medopunsher
0
89
Member Avatar for plang007

[CODE]#include <iostream> #include <fstream> #include <iomanip> #include <cmath> using namespace std; int main() { char fare; char choice='Y'; int hrIn, minIn, hrOut, minOut; int hours; int minutes; int total_minutes; double cost; float charge; while(choice=='Y'||choice=='y') { cout << "\nThis program will calculate a group " << "\nfare amount which is then …

Member Avatar for rxlim
0
151
Member Avatar for water_ox

I need help with this assignment that I have to do. I am new to C++ programming and I do now know how to start this lab. Here is the instruction to the lab..please help.. COMP-122 Lab 6 Grade Arrays Objectives: • Use an organized, modular approach to develop programs, …

Member Avatar for jonsca
0
219
Member Avatar for Dadkhah

Hi. I using this Thread "Serial port communication using C++ = "http://www.daniweb.com/forums/thread56329.html" and I change it for solved the some error in program. This is my source code: serial.h #[CODE]define FC_DTRDSR 0x01 #define FC_RTSCTS 0x02 #define FC_XONXOFF 0x04 #include <stdio.h> #include <time.h> #define VC_EXTRALEAN #include <string.h> #define ASCII_BEL 0x07 #define …

Member Avatar for Dadkhah
0
250
Member Avatar for Kunal Aggarwal

[CODE]void CScreenCoordDlg::OnMouseMove(UINT nFlags, CPoint p) { GetCursorPos(&p); m_ValX = p.x; m_ValY = p.y; UpdateData(FALSE); }[/CODE] I used the following code to get the mouse coordinates on mouse move. But the problem is as soon as the mouse moves out of the dialog window it stops updating the mouse coordinates. Although …

0
107
Member Avatar for Gregor97

I have had no previous programming experience and want to start learning C++. T was hoping if you could reccomend a good book. P.S. I've been thinking about [I]C++ Primer Plus[/I].

Member Avatar for alex55
0
138
Member Avatar for dprakashkumar
Member Avatar for lochnessmonster

im curious as to why when i make a dll win 32 project in visual studio 2010, it doesnt show my dllmain function so i can work off that and leaves me with an blank .cpp.(and no i didnt click empty project). How can i fix this? -thx

Member Avatar for Ancient Dragon
0
42
Member Avatar for jogieglenmait

i have a program that would display the productName,productPrice,productCode. each is a separate array. the program would prompt user to add,delete,or search a productName,productPrice,productCode. here's what i tried to do: [CODE]string productName[100]={"milk","beef"}; int productPrice[100]={10,11}; string productCode[100]={"a1","a2"}; int x,y,z; char choice; string search,name,price,code; cout<<"what do you want to do?"; <<"[S]earch."; <<"[A]dd."; …

Member Avatar for attefeh
0
148
Member Avatar for riotburn

I just got a program that does forward substitution. It is working fine but I would like to make it so the user can enter size of both 2D n x n array and a n x 1 array and then be able to enter the elements of the arrays. …

Member Avatar for attefeh
0
5K
Member Avatar for A C++Programmer

I'm trying to make a program that will scan the screen for a certain color. i tried to use GetPixel(), but it is too slow. someone else recommended i use GetDIBits(). Can anyone explain or give an example source on how to scan the screen for a certain color with …

0
41
Member Avatar for strungoutfan78

Hey everyone. I'm brand new to C++ and programming in general and this is my first post here. I've found lots of good info here and these forums helped me a lot last semester. I've got a problem here though. This is a small bit of code I had to …

Member Avatar for strungoutfan78
0
397
Member Avatar for MaDo4

Hi, I have an assignment where i'm supposed to read from a Input File and save it to an output file. The final expression should only contain alphanumeric characters. The code that I have so far gives me both symbols and alphanumeric characters. I was wondering if anyone saw anything …

Member Avatar for MaDo4
0
180
Member Avatar for kra9853

The function Generate_And_Display_Bill() has no formal parameters and returns a variable of type float. The function generates a random number between $0.01 and $99.99 and returns the value to main(). This is what I've created so far in my function declaration; [CODE]#include <iostream> #include <ctime> float Generate_And_Display_Bill() { float Random_Bill; …

Member Avatar for kra9853
0
168
Member Avatar for techningeer

I am using the CodeLite IDE. I compiled the following program using CodeLite (It is a C++ program): [CODE]#include <iostream.h> int main() { cout << "Hello World\n"; return (0); }[/CODE] It returns this message: g++ -c "/home/keagan/.coding-work/Hello/printamessage.cc" -g -o ./Debug/printamessage.o "-I." "-I." /home/keagan/.coding-work/Hello/printamessage.cc:1:23: error: iostream.h: No such file or directory …

Member Avatar for techningeer
0
381
Member Avatar for crapgarden

[B]QUESTION 1[/B] In this line of code, I get that it's using the date/time to seed the code for a more random number each time, I'm just wondering what the < > operators are doing? [CODE]srand(static_cast<unsigned int>(time(0))); [/CODE] I realize, they're making time into an unsigned int, but why not …

Member Avatar for pseudorandom21
0
455
Member Avatar for LKMaxwell

All, I’m new to C++ and trying to figure out the best way to do a multidimensional array of pointers to a class. The code I am presenting demonstrates several questions I had and am hoping to get some help with each question. The basic idea is to create myMatrix, …

Member Avatar for pseudorandom21
0
237

The End.