51,593 Topics

Member Avatar for
Member Avatar for muffinhead

I'm writing a program that is supposed to be able to bubble sort data by name and by average. The data I'm given is student last name followed by 3 scores, all put into a text document. I'm to read the names and scores into their respective parallel arrays, and …

Member Avatar for Ancient Dragon
2
121
Member Avatar for merse

I would like to initialize a user defined struct with the = operator and a scalar type (for example: double) on its right hand side, like this: [CODE] struct real { double value; double error; ... }; int main() { real x = 1.; // supposing error=0. } [/CODE] It …

Member Avatar for amrith92
0
133
Member Avatar for ticktock

Hey so this is an assignment and what we have to do is: [quote] Design a class that can be used to represent types of food. A type of food is classified as basic or prepared. Basic foods are further classified as Dairy, Meat, Fruit, Vegetable, or Grain. The services …

Member Avatar for ticktock
0
142
Member Avatar for joshjgordon

I am having some issues creating a 2-d vector. I need it to be of a determined length in the first dimension but of an undetermined length in the other. The length in the second dimention will be calculated later in the code, in one of the functions that uses …

Member Avatar for jonsca
0
92
Member Avatar for Duncans Ghola

These function calls are not compiling for some reason, I receive the following error message when I attempt to compile. [QUOTE]hw11.cpp: In function âint main()â: hw11.cpp:70: error: expected primary-expression before â]â token hw11.cpp:71: error: expected primary-expression before â]â token hw11.cpp:71: error: expected primary-expression before â]â token hw11.cpp:72: error: expected primary-expression …

Member Avatar for Duncans Ghola
0
214
Member Avatar for PDB1982

I am trying to add a row of int's that are located in separate arrays within my code. I am trying to get these grades to add and then turn it into an avg. My output is crazy though, and I can't figure out why....any ideas? this is the information …

Member Avatar for jonsca
0
171
Member Avatar for josey_matt

Hi, can anyone plz check my code to see why in the prinCLASSdata function the int A, int B ... doesn't have a value. even though it is right in the updateFrequencies function. [CODE]#include<iostream> #include<fstream> #include<string> using namespace std; void read_data(int size,string name[],int test1[],int test2[],int test3[],int test4[],int test5[]); void calculateAverage(int …

Member Avatar for josey_matt
0
127
Member Avatar for redrum237

hi this program starts off with random letters, then using a genetic algorithm eventually forms the "hello world!" basically i need this code to be able to input a word of the users choice, everytime i try something i get an error of some sort thanks [CODE]#pragma warning(disable:4786) // disable …

Member Avatar for programmersbook
0
408
Member Avatar for dapage

I have been working on a C++ program that is a tic-tac-toe game. The problem is that after I win or lose, the program does not end. Here's the code I have written so far (I even wrote comments to make it easier): [CODE] #include <iostream> #include <ctime> using namespace …

Member Avatar for jonsca
0
153
Member Avatar for stefanief

I am trying to write a point of sale program. I need to display the menu, the operator enters the lunch order. Total bill is calculated with sales tax, customer payment is accesped and change (if any) is calculated. order summary should be written to a log file that includes …

Member Avatar for jonsca
1
116
Member Avatar for nunchuckie

Hi, I've used getline and pushed back a text row into a vector. The vector is of string type and I want to sort out the numbers and store it elsewhere. in my vector: The man is 67 years old and driving an Oldsmobile Rocket 88 I want to sort …

Member Avatar for Clinton Portis
0
116
Member Avatar for Jiwe

Can anyone tell me how or help me to get a Window's Title and save it to a TXT file? I tried couple of things with the GetWindowText() but only manage to get some numbers.

Member Avatar for William Hemsworth
0
279
Member Avatar for Tex09

The contents of the array are safe within the function, however, upon returning to main the data becomes garbled. section of main: [code=c++] unsigned short tcp_port = atoi("8080"); const char* workDir = "WhatInthe?"; // Parse command line arguments if ( parseCmdArg( tcp_port, workDir, argc, argv) == 1) return 1; cout …

Member Avatar for Tex09
0
203
Member Avatar for AbsoluteCPP

[B]Description[/B] I want to have a video conference system. [LIST=1] [*]That is the client-server model. [*]The client can send audio/video/document(like ppt.doc.xls..)/application sharing/chat functions. [*]The client's window can receive 16 videos(from other clients). [*]The client can work on windows platform. [*]The server can work on windows or linux(it's better). [*]The video …

Member Avatar for AbsoluteCPP
0
119
Member Avatar for NitaB

Hey guys! I guess my other post wasn't so clear...probably because I wasn't sure what exactly I was trying to do. Anyway, right now I am having problems reading my input file into my 20x20 2D array. I mean, it compiles fine. But, I have a print function just to …

Member Avatar for NitaB
0
174
Member Avatar for samsons17

This is the answer for one of the simple function question from my programming lab... [CODE]#include <iostream> using namespace std; void displayHi(); int main(void) { displayHi(); } void displayHi() { cout<<"I love c++"; } [/CODE] but what i dont understand is why we should put [B] main(void)[/B]?? why dont simply …

Member Avatar for Ancient Dragon
0
156
Member Avatar for confusedndazed

I'm having trouble understanding how to write a function call. This is what I have so far: [CODE]#include <ionstream> using namespace std ; int binomial(int n, int k) ; // function prototype int main () { int n, k ; // parameters for the binomial number int result ; cout …

Member Avatar for amrith92
0
147
Member Avatar for juniper2009

Dear All I am trying to create a list of characters already given as below. When I compile it it gives me following errors. In function `int main()': 17: error: `islowerCase' undeclared (first use this function) 17: error: (Each undeclared identifier is reported only once for each function it appears …

Member Avatar for amrith92
0
145
Member Avatar for AbsoluteCPP

This must be a frequently asked question, but I can't find the answer in the FAQ, or in the recent archive of this list, or by using google with the keywords I thought of. I would like to use libavcodec.dll and libavformat.dll in my Windows XP Visual C++ 2008 project. …

Member Avatar for programmersbook
0
305
Member Avatar for samsons17

HI.... I'm doing this question... [B]Question Using a non-void function with parameters, write a complete C++ program that prompts the user for the Cartesian coordinates of two points (x1, y1) and (x2, y2) and displays the distance between them computed using the formula: distance = sqrt( (x1-x2)^2) + ((y1-y2)^2)... [/B] …

Member Avatar for hajiakhundov
0
244
Member Avatar for asator

am an engineering student and took the AI course by mistake ! and the doctor asked for this assignment ! and am not a programmer and dunno anythin in c nor c++ so i need your help people please ! 20 marks on this assignment ! 1- build a graph …

Member Avatar for Nick Evan
-3
74
Member Avatar for Jiwe

I made a function SetRegistry() to write a string in the registry like this: [CODE] void SetRegistry() { HKEY hKey; RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"),0,KEY_SET_VALUE,&hKey); RegSetValueEx(hKey, TEXT("filenamehere"),0,REG_SZ,(LPBYTE) "C:\\Windows\\filenamehere.exe",sizeof("C:\\Windows\\filenamehere.exe"); RegCloseKey(hKey); } [/CODE] NOTE: C:\\Windows\\ is the path where the .exe file I want to add is. it sets the string with the filename and …

Member Avatar for Jiwe
0
2K
Member Avatar for Annettest

Hello everyone: I am a C++ newbie; I am interesting in using C++ in my work on coupled fluid flow-chemical reaction problems. I apologize in advance for what is probably a very simple question. I would very much appreciate some help to get me on the right track! My goal …

Member Avatar for Nick Evan
0
240
Member Avatar for foxmulder

Hi! I put this simple, I got an assignment that's following: [B]Write a function that return the amount of all integer from zero (0) to a number that was given as an argument.[/B] How do I do, I dont even understand the question? Thanks in advance! //Adam

Member Avatar for samsons17
0
142
Member Avatar for nunchuckie

Hi guys, I'm trying to find a way to read a chosen line from a text file. Like I want to read line 2 and then the program will find the second text line for me to read. Any tips? :)

Member Avatar for nunchuckie
0
137
Member Avatar for adi.shoukat
Member Avatar for ausrasul

Hi, I've wrote a C++ program on windows (client-server) using gcc with following commands: [code] SOCKET(...) bind(..) select(..) recv(..) send(..) close(..) [/code] 1- If I want to convert the application to use SSL3, what should I change? I need a general overview to get me started. 2- If I want …

Member Avatar for programmersbook
0
261
Member Avatar for blamp

Can someone help me figure out why nothing comes up on the output screen. The program compiles but the the output is blank. 1. Maintain information on all students. Each student has the following: 1st line - lastname, city of residence, student id, ssn 2nd line - course, course id, …

Member Avatar for pecet
0
132
Member Avatar for stacia

hi i am a fourth year computing major and i need some help with the following assignment. The program is to simulate the operation of one day's activity at an airport, and output the times waiting to land and take off for each BWIA flight. the program should include the …

Member Avatar for m_usman
0
2K
Member Avatar for red999

Whenever I am getting a line from a file by using the string getline() function, I seem to be getting an extra character. I am curious to know what exactly that character is. It recently caused me a bit of trouble trying to debug. Let's say the file is like …

Member Avatar for Ancient Dragon
0
145
Member Avatar for Talguy

I am revisiting my EE senior design project that I finished up about 8 months ago. We basically took your vehicles instrument cluster and replaced it with a computer and graphically rendered your vehicles metric with the help of a datalogger. For the graphics I used cairomm for its vector …

0
61
Member Avatar for NitaB

Hey everyone! Sooo, I'm working on this program that's basically a practice on using 2D arrays. I am going through this step by step so first I just want to be sure that my program is reading the file and putting the information into the correct places in my array.(It …

0
68
Member Avatar for tomtetlaw

When I try to run my program( which is a test entity system for anyone who's wondering ), I get a Stack Overflow error, and I cannot find the source of this error. Here is my code: baseentity.h: [code=c++]#ifndef BASEENTITY_H #define BASEENTITY_H #include <vector> #define DECLARE_CLASS( className ) public: virtual …

Member Avatar for tomtetlaw
0
240
Member Avatar for NitaB

Hi again! I've been working on this program and I am thankful for all the help and tips I've gotten from this forum. However, at the moment I can't seem to get this selection sort to work on my array. I've tried it 3 different ways(will post code below) and …

Member Avatar for NitaB
0
135
Member Avatar for Luciano555

Hey guys, I am trying to make a simple program that interacts with TeamSpeak v2 (this is the current version that I have installed on my computer) and changes its text. The only problem is that it finds the window using FindWindow perfectly, but it doesnt do anything to the …

Member Avatar for Luciano555
0
79
Member Avatar for lovely ari

hi there i have problem making this program its rely difficult on me the idea of the program is (1) To parse a string to determine if it conforms to the grammar & (2) To generate strings conforming to the grammar this is the grammars we must start with S …

Member Avatar for Clinton Portis
0
72
Member Avatar for gen84

Write a program that will ask the user for 10 numbers, store them in an array, print the array, and print the average of the numbers entered. You should: All steps should be pseudo-coded before actually going to the computer, and you will be required to submit the pseudo-code of …

Member Avatar for mrnutty
-3
97
Member Avatar for piyushsol

i used template funtion but its not working... it shows error like....... could not find match for func(char *,int).... in this program i m tring to find a charcter's location from user provided 5 characters. for this used template function...[code]#include<iostream.h> #include<conio.h> template<class temp> int func(temp *array[],temp loc) { char ch; …

Member Avatar for programmersbook
0
83
Member Avatar for adi.shoukat

Hi, can anyone tell me that how can i check,In C++ Code, if the app i am working on is IE Or FireFox ?? Details: I want to make a c++ programe that Once I run it's exe ... and after that when my Ctrl is on IE/FireFox my C++ …

Member Avatar for Clinton Portis
0
97
Member Avatar for sexyzebra19

I'm testing this program for: x^2 + 0.17714x -2.5147583 with k = 1.4997 I've been looking at this for hours and have worked through it on paper, but can't figure out why line 59 is calculating C[1] as 0.17714. C[1] should be 1.6768. Can anyone please help me figure this …

Member Avatar for mrnutty
0
112
Member Avatar for Eternity[LK]

Hello :) This is my first post on daniweb forum and I hope this site will help me improve. I'm a first year college student in computer science, and I've only recently started C++. This means that code posted by me might seem very lousy and /or unprofessional. I have …

Member Avatar for Eternity[LK]
0
97
Member Avatar for r00ty

Hi , i have 2 txt files full of names , read line by line and compare. If name from first file exist in second , i don't write it to result file. My code work excelent with small files , but when i try big files (100 MB) , …

Member Avatar for r00ty
0
162
Member Avatar for Trekforever

Hi, I'm trying to write a function that takes in a c-string, and remove all 'T' and 't' from the string. So here's what I have so far, but every time I try to compile it, it gives an empty character constant error. [CODE] void removeT(char* msg) { char* ptr; …

Member Avatar for JasonHippy
0
1K
Member Avatar for shenberry

I have a simple time tables that goes from 1 - 100. It takes like 6000 seconds to run. I figured I could break this down into a a multi thread program main thread for(int c = 1; c < 101; c++) { cout << c << "| "; for(int …

Member Avatar for shenberry
1
154
Member Avatar for Snippset

Hi, I need to make a program, which I think should be simple if you know what you are doing. You have an array of integers A(m, n) and B(m). Delete an element from A array, which index is in the B(m) array. Print original and modified arrays. I don't …

Member Avatar for Snippset
0
100
Member Avatar for grafas7

Hi i'm new here ,and i'm still rookie at working with C++ Builder 6 I have a task ,which i don't understand. My task is like that :.. Number array E (m,n) and i need to replace all the line and column even(oddly) numbers to 0(zero). Please im praying you …

Member Avatar for grafas7
0
137
Member Avatar for martidim

i'm interesting of source code example :[url]http://downloads.sourceforge.net/project/openrrcp/openrrcp/0.1.93/openrrcp-0.1.93.tar.gz?use_mirror=ignum[/url] this is program for manage switches with rrcp protocol. To compile source code it's need to install 1. Winpcap ([url]http://www.winpcap.org/install/bin/WinPcap_4_1_1.exe[/url]) 2. [url]http://www.winpcap.org/archive/2.02-WPdpack.zip[/url] 3. [url]http://www.csie.nuk.edu.tw/~wuch/course/csc521/2007/ex1-winpcap/[/url] -->Here is example how to compile program in visual c++ with winpcap Everythings what i found in google for …

Member Avatar for Ancient Dragon
0
158
Member Avatar for ENCHTERP

Hello: If I have a 2d Vector and I want to convert it to a 2d Array what would be the best way to accomplish that. I know that I can go through a for loop to do it element by element but I would prefer to use the copy …

Member Avatar for mrnutty
0
129
Member Avatar for Phil++

If you were asked to describe the techniques to C++ would you talk about like, Inheritence, Re-use etc or something else? I don't understand :( Help please!

Member Avatar for mrnutty
0
91
Member Avatar for mikesr

Hello! I am new one here. Firstly I would like to say that I'm really poor in english, so be patient with me.. In the school we had a new task. So let me explain: we have a 2d array with numbers.. like this: 0 1 2 4 5 6 …

Member Avatar for mikesr
0
289

The End.