51,593 Topics

Member Avatar for
Member Avatar for nerdthon123

To All Daniweb users, I have just started the programming trail of learning, i recently got courses from E learning center on how to use C++. The first Code (the hello world project) is where I'm having a problem. On Visual Basic 2010 Beta2 which is the only one that …

Member Avatar for jonsca
0
127
Member Avatar for trzypak

so i was supose to create a software for my class that converts the 24 hour notation to 12, but now i got really lost with it i used the A symbol to display am and the P symbol to display pm heres what i have so far but i …

Member Avatar for jonsca
0
117
Member Avatar for discovery-power

Hi All, I recently made the move from Windows to Mandriva Linux 2010, in Windows I used an IDE to write my code then build my projects, in Linux I cant find a suitable IDE im really struggling to build my projects. Now I can write my projects in kwrite …

Member Avatar for discovery-power
0
118
Member Avatar for wingers1290

Hi, this is the final step of my program, so far I've set a button to change the default save location and now the last step is to be able to click on the serialized file and have it open in my form. The problem is I don't know how …

Member Avatar for wingers1290
0
201
Member Avatar for Puddles

I am attempting to write a program that interfaces with Command prompt (simple, bring up a tasklist, user enters the program they want to get rid of, and then the computer does the rest), I already have been able to interface and bring up a tasklist, the code compiles with …

Member Avatar for Puddles
0
236
Member Avatar for jigglymig1

this function needs to ask for a persons name, phone number, and email. BUT it only needs to do this once at a time because it returns to a menu and asks if they want to add more people. I need a way to increment count by 1 each time …

Member Avatar for tkud
-1
113
Member Avatar for tkud

Hey everyone, I'm having this problem with the aforementioned API. Here is the code to initialize the common controls i want to use..(commctrl.h is already included in my program) [CODE] INITCOMMONCONTROLSEX icex; icex.dwSize=sizeof(INITCOMMONCONTROLSEX); icex.dwICC=ICC_BAR_CLASSES; InitCommonControlsEx(&icex); [/CODE] However, when I try to build , it gives me this error: [I] 1>tkud.obj …

Member Avatar for tkud
0
3K
Member Avatar for zobadof

I have learnt: Hello World, Input, Operators, Square of a number, Making decisions and Repeated question. I don't know what would be best; either to revise on that, or move onto something else. I would like to know what would be the best idea for me next. Thanks, Zobadof

Member Avatar for zobadof
0
53
Member Avatar for zobadof

Sorry in advance! I did solved thread before I checked if the code somebody said worked. It turned out they didn't help much. The problem is MattyRobot gave me code to open a new window. Now it opens with CMD to; I only wanted the window. I will give you …

Member Avatar for zobadof
0
131
Member Avatar for kele1

i'm writing a program that creates a file called 'hardware.dat' and i'm supposed to be able to insert a record, update, and delete a record. first i'm having problem with the insertrecord cause it keeps giving me an infinte loop. i'm creating file that would hold these data: record # …

Member Avatar for Clinton Portis
-1
97
Member Avatar for trcartmill

[CODE]void GetData(fstream& In, string& Name, double& Acres, int& Jars); /*Pre: The stream in is open for input. Post: Returns the name of less than or equal 29 characters, acres and number of jars. */[/CODE] I am using this function to pull names from an infile. The first line of the …

Member Avatar for Clinton Portis
0
107
Member Avatar for C++ Beginner

When I run the program it only prints out the numbers entered into the array but it will not print out the name of the array. Can anyone assist me on why it is not working? Example: The amount each salsa sold are: 4 The amount each salsa sold are: …

Member Avatar for zobadof
0
75
Member Avatar for mloC

This Program is supposed to get a filename, title and description of a database and then store it to and appropriate filename. [CODE] #include <fstream> #include <iostream> #include <cstdlib> #include <string.h> #include<ctime> #define MAX_FILENAME 256 #define MAX_INIT_NAME 1024 #define MAX_DESC 1024 using namespace std; class date { public: int DAY; …

Member Avatar for mloC
1
96
Member Avatar for FancyShoes

I am having problems with my white pegs for my mastermind game. The white pegs mean that the user guessed the right color but it is not in the right spot. The problem is that it prints out the white too many times for 1 guess. The problem is in …

0
86
Member Avatar for merse

It is possible to restrict template parameter? [CODE]template <class T> class myclass { ... };[/CODE] For example I want that T might be int double or my own defined complex but nothing else!

Member Avatar for mrnutty
0
246
Member Avatar for hotice47

Hi .. i am new in programing and i need to solve this problem ..so far i have done few things but there are some thing missing which i can understand ....so plz help.. The program is to be used to calculate the loading on a beam by a single …

Member Avatar for hotice47
1
138
Member Avatar for new programer

hello all I'm trying to do a concatenation function I do not want to you use the strings property where we can add strings, I need to add two strings and save them in one string without the use of addition "+" i have three variables title , first_name, last_name …

Member Avatar for new programer
0
157
Member Avatar for merse

I have a very simple code and I don't understad it's result. I think, this have to print "OK" but does not! [CODE] #include<iostream> #include<math.h> class real { double value; double error; public: real(double,double); friend bool operator==(const real&,const double); }; real::real(double val, double err) : value(val), error(fabs(err)) {} bool operator==(const …

Member Avatar for merse
0
101
Member Avatar for halluc1nati0n

[CODE]#include <stdio.h> #include <fcntl.h> #include <iostream> using namespace std; int main() { int fd, i, oflag; char buf[100]; oflag = (O_RDONLY); fd = open("from4to5", oflag, 0x1c0); if (fd < 0 ) {printf("Error opening\n"); exit(1);} while ( (i = read(fd, buf, 16)) != 0 ) { cout << "child: # bytes …

Member Avatar for halluc1nati0n
1
310
Member Avatar for biesczadka

Can anyone show me how I should split my code for makefile???? and how makefile would look like?? I must say that I have NO IDEA how to do that Actually I think that I don't understand how makefile works I'll be gratefull for help!!!!!! MY CODE: [CODE] #include <iostream> …

-1
57
Member Avatar for merse

[CODE]#include<iostream> #include<math.h> class real { double value; double error; public: real(const double,const double); double get_value(); double get_error(); friend bool operator<=(const real&,const double); }; real::real(const double val, const double err) : value(val), error(fabs(err)) {} double real::get_value() { return value; } double real::get_error() { return error; } bool operator<=(const real& x1, const …

Member Avatar for Narue
0
116
Member Avatar for MattyRobot

what would be a good way to load images to use for texture mapping in opengl? I have looked at tutorials such as nehe lesson 6 and some other resources but they all use something old and depreciated that I cant compile.

Member Avatar for Sodabread
0
363
Member Avatar for Natique

Hi, I wrote a program where I get a debug assertion failure. I've made it so that if I press ignore, execution continues correctly. The only thing is I don't want to keep pressing ignore, is there a way to make it ignore automatically? Without the message box appearing? I …

Member Avatar for Narue
0
1K
Member Avatar for f0rcegr0wn

Hi all, just to be sure. I have a C++ DLL in which I am implementing a bit of low-level functionality. To this library I wish to pass a managed System.String pointer (ref) so that the library can load the string with the new/returned value. The question is, do I …

Member Avatar for cikara21
0
177
Member Avatar for reyarita

1. (PrimeNumbers) An integer is said to be prime if it is divisible by only 1 and itself. For example, 2, 3, 5 and 7 are prime, but 4, 6, 8 and 9 are not. a. Write a function that determines whether a number is prime. b. Use this function …

Member Avatar for ddanbe
0
74
Member Avatar for kavourdoukos

I have got this class:[CODE]class sample{ private: int number; string adress; public: int get_number(); string get_adress(); sample(); ~sample(); };[/CODE] I allocate dyanmically memory space like this(cause i need an array of pointers to obects):[CODE]sample** samples; samples=new sample*[20]; for(int i=0;i<20;i++){ samples[i]=new sample;}[/CODE] My question is how can i sort this array …

Member Avatar for JasonHippy
0
156
Member Avatar for confusedndazed

Hello all, I have my assignment topic and I know what information I would like to include in my assignment. Can anyone tell me how to put my data into top-down format? Here is what I have thus far: I'm trying to design a program that will input ages of …

Member Avatar for confusedndazed
0
121
Member Avatar for reyarita

Hey guys!! can you share some ideas about this program, i tried but its not working. 1. Write a program that inputs a five-digit integer, separates the integer into its individual digits and prints the digits separated from one another by three spaces each. For example, if the user types …

Member Avatar for reyarita
0
116
Member Avatar for indev

Hey everyone. Some back info : I have been developing in C for about a year now on and off. Recently I grabbed myself a C++ book and am progressing at a steady rate. Up until recently I have been developing small applications and done a lot of ports. Wolfenstein …

0
41
Member Avatar for zainhamza

hi, I'll be greatful if someone tell me how to declare the preiority queue in c++ and also tell me the syntax that how we can put a node in a preority queue. Regards Zain

Member Avatar for Narue
0
220
Member Avatar for zobadof

MattyRobot as you may know him, gave me the code to make a new window, but it opens up cmd window too. I would like it so the window opens only. If anyone knows the code, I would be more than happy to find out

Member Avatar for zobadof
0
124
Member Avatar for Frederick2

[CODE=C++] /* I'm stuck! Here is what I consider to be a perfectly running program that uses an array ( TArray ) template to hold arrays of objects. Its just about your classic text book example. Its pretty well stripped down to nothing to illustrate my problem. I simply don't …

Member Avatar for Frederick2
0
199
Member Avatar for TimeWalker

Here's the code that increases x value by 0.01 increment and outputs: x, placeholder for initial x+t and how many loop cycles it took to find a solution to the equation in function f1() in intervals for temp (0.5 ; 1.0)U(1.0 ; 1.5). [code] #include <iostream> #include <cstdlib> #include <cmath> …

1
60
Member Avatar for lotrsimp12345

Is my understanding of a vector list correct. vector<list<int>>. The vector holds a list of data type int? [CODE] class my_ht_chain { public: //constructor which creates a table of a certain size my_ht_chain(int size); //destructor ~my_ht_chain(); //insert a value based on key void insert(int key); //search for a value based …

Member Avatar for lotrsimp12345
0
96
Member Avatar for halluc1nati0n

I have trouble understanding the compilers. The following code does work in UNIX under g++, but under VC++ it would not even compile. Anyone can provide valid reasons why? [B]Code:[/B] [CODE]#include <stdio.h> #include <iostream> #include <string.h> using namespace std; int main() { string tmp_nw_msg, crc_chksum, buffer; cout << "Enter the …

Member Avatar for Nick Evan
0
262
Member Avatar for stevechow

My program takes numbers from a .txt file then puts it in, so that an array has a "bacteria" in it. The "bacteria" will die if it has 4 or more, or if it has 1 or less. It will live with 2-3 neighbors. If an empty cell has three …

Member Avatar for Nick Evan
0
109
Member Avatar for grib

Just got back to my interrupted attempt to pick up C++, and I'm already shipwrecked again. Anyway... I'm trying to build another bitty app from my text, but nothing seems to be coming together properly. The program should ask for an array length, send that to an input-handling function, then …

Member Avatar for grib
0
403
Member Avatar for merse

It is possible to choose template parameter in runtime? when i try to construct an object wich has template parameter

Member Avatar for mrnutty
0
108
Member Avatar for keyzzz_it

hi!!! im a new member of this organization of the IT's. im a freshmen student ,takig up IMFORMATION TECHNOLOGY and i have a problem regarding how to make a calculator using SWITCH CASE, i've tried to make a program of that using other functions and it made it successfully but …

Member Avatar for xavier666
0
179
Member Avatar for charlie221133

hello, I'm a computer science student. I'm starting to get into the more challenging aspects of C++. Where can i find a good website for quickly finding syntax. Say i want to solve a simple problem, but i don't know the exact syntax, where can i quickly find code snippets …

Member Avatar for mrnutty
0
72
Member Avatar for lotrsimp12345

Do I need a copy constructor? [CODE] #ifndef MY_MIN_PQ_H #define MY_MIN_PQ_H #include <iostream> #include <vector> using namespace std; class my_min_pq { public: //default constructor my_min_pq(); //destructor ~my_min_pq(); //insert element at end of sequence, and rearrange so minimum data at the front of array void enqueue(int data ,int priority); //removes data …

Member Avatar for lotrsimp12345
0
125
Member Avatar for laelzio.mosca

I have this code for a tic tac toe game, it`s not done yet, and what I have done isn`t working like I want it to. The screan prints and promps player 1 and 2 for inputs one at a time, but my while loop in main is probably wrong, …

Member Avatar for jonsca
0
63
Member Avatar for sperrytx

I am a beginning c++ student and need to read in a text file as shown below: [code=text] Orvilles's Acres, 114.8 43801 Hoffman's Hills, 77.2 36229 Jiffy Quick Farm, 89.4 24812 Houston Bayou Texas Home Grown Popcorn Inc., 124.7 65687 [/code] The criteria is to read characters to comma then …

Member Avatar for Clinton Portis
0
292
Member Avatar for besbis cat

hey guyz how r u?? plzz i rly need ur help with this 1.. coz i dnt know how 2 writ it..:( Writ a program estimate how much a young worker will make before retiring age of 65. request the worker’s name, age, and starting salary as input. Assume the …

Member Avatar for wareagleau
-3
163
Member Avatar for guccitan88

I have to write a function to populate a 50 element integer array with random numbers: 100 <= # <= 1000. I have everything I need in the code except the "between 100 and 1000." The things I'm trying are not working. Thanks! [CODE] #include <iostream> #include <cstdlib> #include <ctime> …

Member Avatar for guccitan88
0
118
Member Avatar for ncwolfe

I'm using Visual Studio 2005. I tried to adapt the existing class for the binary search tree (from my book) to a template and mostly it works, but I'm getting errors related to the insertNode and deleteSubTree functions when I try to build it. The header file: [CODE] // Specification …

Member Avatar for ncwolfe
0
224
Member Avatar for cwarn23

Hi and I have just downloaded the Irrlicht gaming engine and although I have had a briefing about it from a friend I can't seem make it do what I want. I got the demo which is nearly what my result will look like but then I tried switching from …

Member Avatar for cwarn23
0
185
Member Avatar for lotrsimp12345

we are supposed to implement using STL vector and base it on priority and have have a data value So every time i enqueue i insert an in item into the end of the vector and if no space i modify. So do i reorder the list to place the …

0
67
Member Avatar for ItecKid

Hello all, I am trying to write a clustering algorithm where, given location of certain points (I.e, latitude and longitude) I need to choose 50 of these to be cluster centers such that the diameter of each cluster is minimized. To that end, I believe that the program should choose …

Member Avatar for ItecKid
0
113
Member Avatar for neumannj656

it builds correctly and runs correctly but when the program gets to the while statement, it just stops completely, does not even allow blind input of data. I know it is a little messy but here is the code: [code=c++]// buildingwillcost.cpp : Defines the entry point for the console application. …

Member Avatar for Evan M
0
159

The End.