51,593 Topics

Member Avatar for
Member Avatar for whoknows101

[code] #include <iostream> using namespace std; // structs/Classes /*********************************************************************/ struct Key { char* data; // string Key () {this->data = NULL;} Key(char* data) { this->data = new char[strlen(data)]; strcpy(this->data,data);} bool operator== (Key& key) { return 0 == strcmp(this->data,key.data);} // is this == to that key bool operator< (Key& key) { …

Member Avatar for ~s.o.s~
0
107
Member Avatar for HelpAUniStudent

This is a skeleton of my full assignment attached. Can anyone please help me out and provide me with guidelines or comments to the assignment???

Member Avatar for jwenting
0
96
Member Avatar for paradoxxx

Hi all, I need help with an old C program, making it work in C++, and changing it a little bit. For now, can someone help me change this line of code to the new function in C++? Thanks and God Bless. Jonn. [CODE]cp = (char *) malloc(strlen(tbuff));[/CODE]

Member Avatar for wildpine
0
183
Member Avatar for green_oasis

I have the following C++ code: [code=cplusplus] class A { private: long num1; }; class B : public A { private: void f1(); }; class C: public B { private: virtual void f2(); }; int main() { cout <<sizeof(A)<<endl; cout <<sizeof(B)<<endl; cout<<sizeof(C)<<end; }[/code] Would someone please help me with the …

Member Avatar for ~s.o.s~
0
171
Member Avatar for tech291083

Hi, I just came across this list of some of the popular applications on the market today which were developed using the C++ language. [URL]http://www.research.att.com/~bs/applications.html[/URL] I am sure that programmers who love this language would be happy to know about this. Please correct me if I am wrong. I would …

Member Avatar for Ancient Dragon
0
250
Member Avatar for benfly08

Hi, I'm having a print problem for my C# windows form program. In my small program, I need to pull out data from my database and format them as invoice format. These parts were done quit well. When it went to printing, something weird happen. I used PrintDocument class to …

0
71
Member Avatar for solomon grundy

I need to Construct a program that inputs the entries of two matrices and multiplies them. Construct the program so that it gives an error message if they cannot be multiplied. What I have done so far I need to Construct a program that inputs the entries of two matrices …

Member Avatar for WaltP
0
109
Member Avatar for solomon grundy

Is this code compiling [code] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <iostream>[/COLOR] [COLOR=#0000ff]using[/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std;[/COLOR] [COLOR=#008000]//Define the Matrix3X3 type.[/COLOR] [COLOR=#0000ff]typedef[/COLOR][COLOR=#0000ff]struct[/COLOR] { [COLOR=#0000ff]float[/COLOR] index[3][3]; } Matrix3X3; [COLOR=#008000]//Function prototypes (functions are defined below main())[/COLOR] [COLOR=#0000ff]void[/COLOR][COLOR=#000000] printMatrix( Matrix3X3 a );[/COLOR] Matrix3X3 inputMatrix(); Matrix3X3 addMatrices( Matrix3X3 a, Matrix3X3 b ); Matrix3X3 subtractMatrices( Matrix3X3 a, Matrix3X3 b ); Matrix3X3 scalarMultiply( Matrix3X3 …

Member Avatar for Nick Evan
0
89
Member Avatar for nicolivolkov

Hi all, I looking for somebody to help me through a final class program. I would be happy to pay somebody to tutor me through this or make a donation. I am not looking for somebody to just give me the answer, but I DEFINITELY need help. It is due …

Member Avatar for nicolivolkov
0
418
Member Avatar for andrax

I'm writing a win32 app that re-paints the client area everytime the user clicks inside of it. Unfortunately after about 25 or 26 clicks the window gets painted white, but the black grid lines still appear. The WM_PAINT case goes through a for loop and asks another class what should …

Member Avatar for andrax
0
219
Member Avatar for newbie2c++

Hi everyone! I am having some difficulty with my code here. I wrote a prgraom that is supposed to receive a non-determined number of fields from an HTML form and return their values back to a browser. I feel like I am almost finished but when I open up the …

Member Avatar for John A
0
87
Member Avatar for newbie2c++

I am trying to finish up this program but it wont compile. I am getting some error messages but don't understand them. Can anyone take a look at my program and see if you can find anything wrong with it? THank you so much in advance this is my final …

Member Avatar for Ancient Dragon
0
125
Member Avatar for Sandtimes

[COLOR=#555555]I am suppose to be creating a program that uses a structure named Moviedata to store the following information about the movie: Title, Director, Year Released, running Time (in minutes).[/COLOR] [COLOR=#555555]The program should create two moviedata variables, store values in their members, and pass each one in turn to a …

Member Avatar for Sandtimes
0
641
Member Avatar for milky

im new with c++ and my lecturer given this question and ask me to solve it. it is difficult to understand it. anyone can help me,pls? [COLOR=#000000]Given the structure[/COLOR] [COLOR=#000000] [/COLOR] [COLOR=#000000]typedef struct {[/COLOR] [COLOR=#000000] char Firstname[20];[/COLOR] [COLOR=#000000]char Lastname [20];[/COLOR] [COLOR=#000000]char add[20];[/COLOR] [COLOR=#000000]char city[20];[/COLOR] [COLOR=#000000]char state[20];[/COLOR] [COLOR=#000000]char zip[6];[/COLOR] [COLOR=#000000]char phone[15];[/COLOR] …

Member Avatar for Infarction
0
124
Member Avatar for pagantom

I'm lost. why won't my objects instantate? Here's the code, compiler errors are below. thanks [code=cplusplus] class date { private: char *mo; int day, yr; public: date() {*mo = 0; day = 0; yr = 0;} date (char *m, int d, int y) {mo = new char[strlen(m)+1]; strcpy(mo, m); day …

Member Avatar for ~s.o.s~
0
129
Member Avatar for tech291083

hi, i m running fedora core 5 32 bit as the os and want to learn a bit of c++ programming. did the search on the net and came across a post telling the fact that something called eclipse can be used to write c++ code and compile it perfectly. …

Member Avatar for ~s.o.s~
0
127
Member Avatar for vicky_dev

Can you write a program that prints its own source code ( in C/C++ )? Of course it would be easy to do that referring to the source file, but how can this program be written assuming that the souce file is not available at run time? :?: :?:

Member Avatar for SpS
0
307
Member Avatar for ambitious

Hi all, I am trying to build extension modules in Visual Studio.NET 2003. I get the following link errors in debug mode, but there are no errors in release mode. _viscoelastic error LNK2019: unresolved external symbol __imp__Py_FindMethod@12 referenced in function _veModelGlobalRayleigh_getattr@8 _viscoelastic error LNK2019: unresolved external symbol __imp__Py_InitModule4@20 referenced in …

Member Avatar for Mohfeza
0
363
Member Avatar for jethroalias97

hi, i'm trying to execute some c++ code from the php script in my webpage, but its not working. the best i could find was the php code below. [code=php] $output = shell_exec('ls -lart program.exe'); echo "<pre>$output</pre>"; [/code] here is the code of program.exe (codewarrior created program.exe from this code) …

Member Avatar for Puckdropper
0
102
Member Avatar for DynamitMsk

Hello, I'm working o a function that takes a file with binary numbers and returns the sum of those numbers. Here's where I'm now [code] int Sum (char *fileName) { char * numEnd; long temp(0); int result(0); string line; ifstream file (fileName); if (file.is_open()) { while (! file.eof() ) { …

Member Avatar for John A
0
110
Member Avatar for backstabber

this program compiles and gives the following return state/code Exit code: -1073741819 this is very irritating i would also ask please do not post the output file here this is a challenge from arcanum i just want a working program. please help me with this program. this is what i …

Member Avatar for backstabber
0
131
Member Avatar for GuruGhulab

Hello there, my question is , i read upto 20 numbers from a file, then i have to sort them into, negatives, odd's and even's, then i have to display total negatives, odd's, and even's, i also have to display all the acutal values of the negatives, odd's, and even's. …

Member Avatar for GuruGhulab
0
137
Member Avatar for the_master

Hi guys how are you , hope you are ok. I have a small problem with my code. briefly my program is about chained sequence numbers which requires a user to enter sequences separated by (-1) in an input file as follow: 123 122 121 -1 45 67 89 -1 …

Member Avatar for SpS
0
101
Member Avatar for Ryan Steyn

Hi there everyone, im new to programming and havent the faintest clue where to start (just so you know:rolleyes: ) . I want to learn C++ but havent the apps to test or write it. I downloaded the microsoft visual studio and it confused the hell outa me. Can anyone …

Member Avatar for jbennet
0
109
Member Avatar for joelw

ok so far this is what ive got for my code im trying to figure out how to start my for loop that will receive the array and the int that represents the count(2)? [code]#include<iostream> using namespace std; struct Student { char Name[30]; float GPA; int Major; }; //Function Prototype …

Member Avatar for Ancient Dragon
-1
322
Member Avatar for sdillinger

In the following snippet of code the compiler (g++ on RH 4) does not see my overloaded operator. I cannot figure out why. Error: parse_opra.cpp: In function `void parseFile(std::istream&)': parse_opra.cpp:19: error: no match for 'operator>>' in 'in >> rec' note: candidates are: std::basic_istream<_CharT,...... ..... opra_record.h:35: note: std::istream& operator>>(std::istream&, Opra_record&) I …

Member Avatar for sdillinger
0
151
Member Avatar for mjmythili

for(i=1;i<10;i++) { cout<<"i= "<<i; } I want to print The label i as well as its value by using Outtextxy. Is it possible. I knew that Outtextxy is used to display strings. but i dont want to use cout.

Member Avatar for vicky_dev
0
582
Member Avatar for newbie2c++

Having trouble getting this to compile. My error message says in line 42 expected ';" before "text" any suggestions? [CODE]#include <iomanip> #include <iostream> #include <cstring> #include <cstdlib> #include <string> #include <ctype.h> using namespace std; struct FORM { string name; string data; }; void getFormData(string, FORM []); //FORM *create_array(int); //string param(string, …

Member Avatar for Anonymusius
0
90
Member Avatar for newbie2c++

I am trying to write a program that will recieve a non-determined number of fields from an HTML form and return their values back to the browser in an interesting way. I am stuck on some of my code because I want to create 1)spaces between the questions 2) add …

Member Avatar for Lerner
0
84
Member Avatar for jobra

Hi I am new to c++. I tried to get current date but when I compile the program, it gives me an error. This is my program [code=cplusplus] #include <iostream> #include <ctime> #include <stdio.h> int main () { char sdate [10]; _strdate(sdate); std::cout<<"Current Date:"<<sdate; return 0; } [/code] when I …

Member Avatar for jobra
0
189
Member Avatar for joelw

ok, im trying to write a function that dynamically allocates an array of integers. The function should accept an integer argument indicating the number of elements to allocate. Lastly the function should return a pointer to the array. If anyone can help much appreciated Thanks in advance

Member Avatar for Lerner
0
389
Member Avatar for snedan

Im usind Dev-C++ and it allows to return more than 1 value :eek:. ok, so here's my code : [code=c] #include <iostream> using namespace std; int intFirst, intSecond, intThird; int BreakUp(int intNumb) { intFirst = intNumb / 100; intSecond = (intNumb - (intFirst * 100)) / 10; intThird = intNumb …

Member Avatar for ~s.o.s~
0
129
Member Avatar for DynamitMsk

Hello, I have a quick question: How do I declare array of strings with a static size entered by user during run time in C++? In C# i'd do [code] // Get user unput (int, # of strings); string[] stringArray = new string[numOfStrings]; //tell user to start imputing the string …

Member Avatar for Ancient Dragon
0
191
Member Avatar for kcdclan

[code] [COLOR=#0000ff]#using[/COLOR][COLOR=#800000]<System.dll>[/COLOR] [COLOR=#0000ff]using[/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] System;[/COLOR] [COLOR=#0000ff]using[/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] System::Diagnostics;[/COLOR] [COLOR=#0000ff]ref[/COLOR][COLOR=#0000ff]class[/COLOR][COLOR=#000000] B {[/COLOR] [COLOR=#0000ff]public[/COLOR][COLOR=#000000]:[/COLOR] [COLOR=#0000ff]virtual[/COLOR] [COLOR=#0000ff]void[/COLOR] F() { Console::WriteLine([COLOR=#800000]"B::F"[/COLOR]); } }; [COLOR=#0000ff]ref[/COLOR][COLOR=#0000ff]class[/COLOR][COLOR=#000000] D : B {[/COLOR] [COLOR=#0000ff]public[/COLOR][COLOR=#000000]:[/COLOR] [COLOR=#0000ff]virtual[/COLOR] [COLOR=#0000ff]void[/COLOR] F() [COLOR=#0000ff]override[/COLOR] { Console::WriteLine([COLOR=#800000]"D::F"[/COLOR]); } }; [COLOR=#0000ff]int[/COLOR][COLOR=#000000] main(){[/COLOR] B^ b = [COLOR=#0000ff]gcnew[/COLOR] D; b-F(); } [/code] It says identifer not found. I dont know why …

Member Avatar for Narue
0
104
Member Avatar for solomon grundy

I need to construct a C++ program where I input from the screen the entries of two 3x3 matrices A and B. My program then computes A-5B. The matrices should be declared as two dimensional arrays. What I have so far [code=cplusplus] #include <iostream> using namespace std; //Define the Matrix3X3 …

Member Avatar for Infarction
0
128
Member Avatar for chuck577

Quick question. I have an updatestring to send into an SQL command. It actually needs to update three columns in one row. I know how to write the string to update one column but is there a way to write this string to update 3 colums in that one row? …

Member Avatar for Narue
0
86
Member Avatar for Cnaly

Could someone help me? I have an [URL="http://www.daniweb.com/techtalkforums/post285021.html#"]file[/URL] in which a list of employees and salaries are listed for each year ex: Year: 2005 No. of Employees: 3 Employee ID Salary 123456 36000.00 123567 32000.00 123678 33000.00 Year: 2006 No. of Employees: 4 Employee ID Salary 133456 31000.00 133567 32000.00 …

Member Avatar for Bench
0
116
Member Avatar for Web Spider

Hi, i have a problem, I want a program written C/C++ that read a bmp file and display it on screen. Any body can help me regarding this problem.

Member Avatar for Bench
0
138
Member Avatar for phuduz

[COLOR=#555555]hey guys i had a [COLOR=#000000]program using a function to form the plurals of English nouns according to the following rules and it just aint working any help would be great thnx[/COLOR] [/COLOR] [code] [COLOR=#555555]//File: lab9-part1[/COLOR] [COLOR=#555555]//Programmer:Ravi Mandair CPSC 1103 Section 10[/COLOR] [COLOR=#555555]//Purpose:To write a program to form plurals of …

Member Avatar for WaltP
0
87
Member Avatar for pugg09

Well after two semesters and three absolutely 'horrible' teachers I've decided to drop my C, C++ courses and move over to a different line of study at college. This is sad really since I'm almost 40 and had been hacking for the past 15+ years and really needed more professional …

Member Avatar for pugg09
0
186
Member Avatar for shadowmoon

ok.. my problem is.. my midterm source code is due tomorw.. unfortunatly i cant get thsi music to play... my group REALLy wants the music and i thin itll boost my chances of an a... when i ran this music in the original(just the music) it runs fine.. when i …

Member Avatar for ~s.o.s~
0
137
Member Avatar for mero_max

please tell anyone who knows about what`s happening in ClassView! I'm using VC++ 6.0 for a project, and I'm trying to organize my classes/files. Using organization like this look fine with me, it compiles fine, but my classview is empty. then i tried even intalled VC++ 6.0 twice but it …

0
56
Member Avatar for jessiegirl

Hi everyone and thanks for looking to help me. I am working with a program involving arrays. I needed to write one that involves the use to have the program take about 10 numbers, list the minimum, the maximum, and the average. Now the program that I have below runs …

Member Avatar for WaltP
0
160
Member Avatar for viv_mbbs

Hi!! can anybody gimme an algo for reversing the words in a string in O(n) time.... Eg..i/p:I love Linux o/p: Linux love I

Member Avatar for John A
0
92
Member Avatar for nasduck

How to write power of e in c++? Like e^3, does computer know e? Can I write it as pow(e,3) ? Thanks a lot.

Member Avatar for John A
0
94
Member Avatar for BeanieRaven

:cry: I have spent hours on this program and cannot get it to produce negatives or INT_MIN. Here is my code. Any help would be so appreciated I can't even begin to tell you... [code] #include <stdio.h> #include <iostream> using namespace std; char *strrev(char *); char *itoa_3(int, char *, int); …

Member Avatar for Infarction
0
102
Member Avatar for kararu

How can I link my c++ program with html/javascript code? My c++ program should have browser interface....Is cgi the only option.I dont want webserver and cgi...What else can I do?

Member Avatar for John A
0
95
Member Avatar for JS1988

Ok so I got this to compile but now all it prints out to the screen is the "*" in my createHistogram function why doesnt it print the mean,median and mode with a histogram of the data? [CODE] #include <iostream> #include <iomanip> #include <fstream> #include <cmath> using namespace std; // …

Member Avatar for JS1988
0
250
Member Avatar for elcrapo

I'm having some trouble with this averaging program. This program is supposed to determine the final average by taking the sum of the products of the scores, multiplied by the weights and dividing by the sum of the weights. The output of the program includes each score-weight combination retrieved, the …

Member Avatar for John A
0
146
Member Avatar for DeadDrunk

Ok, I'm freaking lost... I can't figure out how to get the "location" variable to work. Its a basic program, you input numbers and it HAS to use a recursive function to insert the new node into the list (even tho I could write 2 lines of code) and well …

Member Avatar for Narue
0
85

The End.