51,593 Topics

Member Avatar for
Member Avatar for miraclebos

Hey Narue! I need ur help on a upper-lower case switch problem.. Read the contents of a text file (using ifstream class).. and create a new file or edit the same one (using ofstream class) to switch the case of each char (upper to lower & vice versa).. Thanks a …

Member Avatar for miraclebos
0
167
Member Avatar for n.utiu

WE have the && operator, the || operator, but xor is only implemented as '^' . And this causes a lot of confusion. Let's take this case: 2 == 2 ^ 2 generates a logical operation instead of bitwise operation , therefore returning a true value. What do yo think: …

Member Avatar for n.utiu
0
227
Member Avatar for rollon

OMG im a IT student but i am not good in programming!! can i ask some question how to be a good programmer????? plss answer my question

Member Avatar for wasimmalik
0
128
Member Avatar for pearle

Hi, everybody. I've started learning about recursion, but I'm having a hard time completely understanding it. I've tried to write a simple recursive function that returns the sum of the series m(i) = (1/3) + (2/5) + (3/7) + (4/9) + ... (i / (2i + 1)), but I keep …

Member Avatar for pearle
0
117
Member Avatar for dude1

ive got a xml file like this: [CODE] <?xml version="1.0"?> <orders> <customer> <order_num>6656</order_num> <name>jon doe</name> <street>123 fake st</street> <city>Beverly Hills</city> <state>CA</state> <zip>90210</zip> </customer> <customer> <order_num>1337</order_num> <name>bob johnson</name> <street>1232 something ave</street> <city>Petaluma</city> <state>CA</state> <zip>94952</zip> </customer> <customer> <order_num>5643</order_num> <name>bill story</name> <street>1st ave</street> <city>Beverly Hills</city> <state>CA</state> <zip>90212</zip> </customer> <customer> <order_num>4533</order_num> <name>tom hutchinson</name> <street>214 …

Member Avatar for dude1
0
172
Member Avatar for jemscomput

16 bit ms dos subsystem Turbo c IDE The NTVDM CPU has encountered an illegal instruction cs:0000 ip:0075 op:f0 00 f0 3705.Choose close to terminate the application.

Member Avatar for jwenting
0
114
Member Avatar for CreativeCoding

I would like to do something like this: [CODE]readfilethingy("www.mywebsite.com/update.txt"); //fail[/CODE] with update.txt being this: [CODE]3.4 http://www.newupdatedownloadlocation.com/ //OR just the http location[/CODE] with the result being: [CODE]*user clicks on update button* "NEW UPDATE IS AVAILABLE! :D" *Clicks download* *Download on .exe starts*[/CODE] So, is it possible? I have searched and searched …

Member Avatar for jonsca
0
115
Member Avatar for mrnobody

Below is a simple code that i wrote about VARIANT. The weird thing is at the end of the code, both vtEmpName and vtDept is "Accounting". [CODE] VARIANT vtEmpName; VARIANT vtDept; vtEmpName.vt = VT_BSTR; vtEmpName.bstrVal = _bstr_t("Joe Schmoe"); vtDept.vt = VT_BSTR; vtDept.bstrVal = _bstr_t("Accounting"); [/CODE] On the other hand, if …

Member Avatar for mrnobody
0
145
Member Avatar for vishalkbhatt

hi all... i m working on a C++ prgm with following definition: Program Definition: Write a program to perform the following on a source file of any c++ program(File shud be included): 1. Count the line of code (LOC) of a source code file 2. Count the total number of …

Member Avatar for Ancient Dragon
0
103
Member Avatar for ashishchoure
Member Avatar for ashishchoure
0
86
Member Avatar for lotrsimp12345

Still having trouble install opencv. I used cmake doing what was told and it created files in a folder then i ran the install VC++ project. After which I went back to cmake and generated the examples. ran those. My path environment variable is C:\OpenCV2.0\bin, I was wondering whether it …

0
58
Member Avatar for Icebone1000

I have something like this: [CODE] VOID *pVBRes; ... pVBRes = new vposnormaltex[(Vfaces.size()/3)]; ... dynamic_cast<vposnormaltex*>(pVBRes)[i].pos = .. reinterpret_cast<vposnormaltex*>(pVBRes)[i].tex = .. reinterpret_cast<vposnormaltex*>(pVBRes)[i].normal =.. [/CODE] What cast should I use ( IF I should use, I dont know if it will work..)

Member Avatar for Salem
0
106
Member Avatar for roc a

I have started this program and it builds fine but when I debug it I get a run-time check error #3, the variable total_sales is being used without being defined. Can some one help me out with this?[code]#include <iostream> using namespace std; void main() { int sp[10][7] = {89, 92, …

Member Avatar for thomas_naveen
0
244
Member Avatar for murschech

A rather old C++ book I have says that one class may be declared a friend class of a second, and then the first class can access the private data of the second. I tried this example [code] #include <iostream.h> class secret { friend class not; private : int a; …

Member Avatar for Abivino
0
128
Member Avatar for CVlaxstar

Hey guys, I'm mostly done with this but need a little help with multiplication and the output. (Just outputting +'s) [CODE]#include<iostream> using namespace std; class Polynomial { friend ostream &operator<<(ostream&, Polynomial&); private: int degree; int coefficient[10]; public: Polynomial(int, int[]); Polynomial operator+(Polynomial&); Polynomial operator-(Polynomial&); Polynomial operator*(Polynomial); }; Polynomial::Polynomial(int d, int c[]) …

Member Avatar for Lerner
0
138
Member Avatar for cruisx

Hey so i am trying to create a file and this is part of my code. [CODE] HANDLE hFile; if((hFile = CreateFileA("Testfile.txt", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, 0)) != INVALID_HANDLE_VALUE) { //and so on [/CODE] Now the problem is that i cant create the file in the program(exe) path. I …

Member Avatar for Frederick2
0
136
Member Avatar for dabboo

Hi, I am new to programming. As an absolute newbie, I downloaded codeblocks and wrote my first programme i.e. Hello World. But when I hit F9 key of my keyboard, the programme didn't run. Can someone guide me as to how a programme is run after writting it in the …

Member Avatar for dabboo
1
93
Member Avatar for Tech E

I have looked and looked and looked at this. I can not figure out why I am getting a random crazy number for salary. Can someone please help? (Sorry for the length) [CODE]//Personal Class Definition #include <iostream> #include <string> using namespace std; //Personal class definition class Personal { public: Personal(string, …

Member Avatar for WaltP
0
172
Member Avatar for mrnobody

Hi, I'm doing a code in MFC to retrieve DateTime from SQL 2005 and then after do datetime manipulation on it. In the SQL table, the date field is 3/16/2010 2:28:20 PM (obtained by using getdate()). I then retrieve the date from RecordSet and stored into _variant_t. To confirm that …

0
66
Member Avatar for thedonflo

I need help writing this program and it has to have user input. It has to be C++ language 1) Write a program that displays the following diamond shape. You may use output statements that display either a single asterisk (*) or a single blank. Maximize your use of repetition …

Member Avatar for Lerner
0
115
Member Avatar for thedonflo

I really need help with this project. 1) Write a program that uses a switch program structure 2) Upon user input your switch structure shall calculate and display one of the three loops for loop, while loop, and do-while loop calculations.

Member Avatar for Stefano Mtangoo
0
113
Member Avatar for dwdude

Hello there. Finally decided to make an account here :) Anyways, I just started trying to implement function pointers in my code, and I seem to be having a few issues. (this is, of course, test code): [CODE] #include <iostream> using namespace std; class MyClass; class SomeClass { public: SomeClass(); …

Member Avatar for dwdude
0
2K
Member Avatar for naveedmahar
Member Avatar for rectifryer

[CODE]#include <cstdlib> #include <iostream> #include <cmath> #include <iomanip> #include <cctype> using namespace std; double distance(double,double,double,double); double radius(double,double,double,double,double); int main() {double X,secX,Y,secY,z,r; r=0; cout<< "Please enter the x value of the center of the circle:"<< endl; cin>>secX; cout<< "Please enter the y value of the center of the circle:" << endl; …

Member Avatar for Banfa
0
403
Member Avatar for janice777

basic over view>> banks offer car loans for periods ranging from two to five years (24 to 60 months). Write a program to allow the customer to enter the price of a car, the down payment amount and the annual interest rate of the loan. The program should display the …

Member Avatar for janice777
0
188
Member Avatar for tararengan

hello, I am running a merge sort routine on an array of numbers. My intention is not to output the sorted array but to reorder the indices of the array so that they reflect the sorted order (descending). For example, if the array were {2, 7, 4}, my indices would …

Member Avatar for tararengan
0
123
Member Avatar for Phil++

Hey, I'm writing this report and I'm writing about variables.. I'm just checking to see if this is a good description: [I] Variables are used in programming to allocate specific memory locations for data, Variables enable the programmer to give a specific name to where the information is stored in …

Member Avatar for WaltP
0
83
Member Avatar for nerdy900

I was starting a cash register program. I got to the point of a simple test. I ran into a problem where when running the loop to input my variables, it completely blows through the loop the first time. I looks like this: Product: Product: ---------now I could input [CODE]#include …

Member Avatar for nerdy900
0
136
Member Avatar for RayvenHawk

I'm doing an assignment for my AI class and while trying to compile the sample code from this weeks chapters I get the 2 following errors. I'm certain I've tackled this before in my 3d programming class, but that was almost a year ago and I'm drawing a blank here. …

Member Avatar for daviddoria
0
146
Member Avatar for StTheo

I'm working on an AVL tree, and I've been getting segfault errors when trying to access one of my nodes. The error is raised when I try to call the balance() function for one of my node's children. [code=c] ////////////////////////////////////////////////////////////////////// /// @file main.cpp /// @brief The main implementation file ////////////////////////////////////////////////////////////////////// …

0
42
Member Avatar for SilentDuck

I'm trying to create this pattern: [url]http://mathworld.wolfram.com/Rule60.html[/url] I cannot get my code to print this. It runs, it just does not print the right pattern. I know I am doing something wrong, I'm just not sure what. [CODE] #include <iostream> #include <fstream> using namespace std; int main() { //Declare variables …

Member Avatar for Banfa
0
211
Member Avatar for Valaraukar

Hi, Basically I have a game type scenario in which objects are falling from the sky onto uneven terrain below but my problem is this: I can't figure out how to determine when an object has actually collided with a slope (the point of impact) because obviously the y value …

Member Avatar for Fbody
0
90
Member Avatar for timbomo

Im trying to figure out how i will calculate items needed. for example for every 500 sqft of space, one gallon of paint and 8 hours of labor is required. how will i put that n to a formula

Member Avatar for timbomo
0
204
Member Avatar for eternaloptimist

/*could someone show me how to create a text file named names.dat with names in a directory with an executable file? i want this program to find a name after i enter it. here r the names that i want to put into names.dat.:*/ "Collins, Bill", "Smith, Bart", "Allen, Jim", …

Member Avatar for Lerner
0
142
Member Avatar for eternaloptimist

i need a function to line up the info with these columns.: Name Test 1 Test 2 Test 3 Average here is the code that i have so far.: [CODE]#include <iostream> #include <iomanip> using namespace std; void arrSelectSort(float *, int); void showArrPtr(float *, int); void showAverage(float, int); int main() { …

Member Avatar for Fbody
-2
1K
Member Avatar for Tech E

I am trying to figure out the best way to create a dynamic array/vector (not sure which) that would take in a string and double and store it. I then need to print the string with the corresponding double into a list and produce a total for all the doubles …

Member Avatar for Lerner
0
108
Member Avatar for sikeufoo

[CODE]while (y==1) { float discount,addcost; pricetopay=calpricetopay(ty,pricetopay,addcost,discount); cout<<endl; cout<<endl; cout<<"\t\t\tTOY TOY Shoppie"<<endl; cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<endl; cout<<"Name of item:"<<ty.name<<endl; cout<<"Price of item:"<<ty.price<<endl; cout<<"Made in:"<<ty.madein<<endl; cout<<"Manufactured Date:"<<ty.date.d<<"/"<<ty.date.m<<"/"<<ty.date.y<<endl; cout<<"Price to be paid: "<<pricetopay<<endl; cout<<"Do you want to proceed with another transaction?"<<endl; cout<<"If yes, Please type '1'. If no, please press 2 to quit."<<endl; cin>>y; }[/CODE] …

Member Avatar for Fbody
0
135
Member Avatar for amol14007

I have been trying searching the net, for source code for converting RTF file to text file in c/c++. The source that i get is in RTF file format which conatins is specific tag but i need to convert it to simple text file and upload it.. Any source link …

Member Avatar for amol14007
0
222
Member Avatar for donazri

Hello guys. I'm trying to create a program, that reads a file, and create an output. Here's the questions: Write a program to compute numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the …

Member Avatar for LevyDee
0
188
Member Avatar for blainegeneral

I have been trying to figure out where this is comming from: [CODE]1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall StudentList::getStream(class std::basic_ifstream<char,struct std::char_traits<char> > *)" (?getStream@StudentList@@QAEXPAV?$basic_ifstream@DU?$char_traits@D@std@@@std@@@Z) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall StudentData::StudentData(void)" (??0StudentData@@QAE@XZ) referenced in function "public: __thiscall StudentList::StudentList(void)" (??0StudentList@@QAE@XZ) …

Member Avatar for Salem
0
208
Member Avatar for bigt666

I've been working on this program and can't seem to understand how to print an output file of the calendar of July. Is there any help I can get? This is the code: [CODE]//---------------------------------------------------------------------- // // This lab exercise is to practice rand(), srand() and // output formating with help …

Member Avatar for WaltP
0
227
Member Avatar for Voltron160

This program sorts in descending order. Hey guys, I am wondering if I could get some help with making this bubble sort program sort recursively. Any help would be appreciated, thanks. [code] #include <stdio.h> #include <conio.h> #include <iostream> #include <stdlib> #define TRUE 1 #define FALSE 0 void bubble (int[], int); …

Member Avatar for LevyDee
0
1K
Member Avatar for BradenMurphy

Hi, I was hoping someone knew a good 2d graphical library for .NET that can: -draw objects (lines, bmps, shapes etc) -these objects can be moved around and resized -this component allows for zooming in on objects -the library must be open source -I am willing to pay for it …

Member Avatar for ddanbe
0
110
Member Avatar for LevyDee

[code] for(.........) { for(.........) { swap } } [/code] Is there really a better way to sort a one dimensional array then to just use a simple bubble sort? Ive heard arguments against bubble sort before, but what do you guys think?

Member Avatar for LevyDee
0
88
Member Avatar for antball06

Ok. So I have been researching and compiling info for the past 15 hrs about this. Hope someone can have some helpful input. What I am trying to do is create a program to use for my construction business to help with estimates of a job to make things easier, …

Member Avatar for LevyDee
0
185
Member Avatar for JonEvans

I'm trying to figure out how to use the max_element algorithm on a vector of structs, rather than POD's like int etc. This is my struct: [code=cpp]struct NameComponents { std::string sValue; std::string sDescriptor; int nOrder; int nStatus; // Construtor. NameComponents( std::string inValue, std::string inDescriptor, int inOrder ) : sValue( inValue …

Member Avatar for Banfa
0
142
Member Avatar for johndoe444

I noticed something interesting today. When I run the executable directly it gives no hint where the segmentation fault happened. But if I run it from gdb it gives the line number where the seg fault happened. So I was wondering whether there is any similar utility which I can …

Member Avatar for Salem
0
95
Member Avatar for aianne

Hi! I need help to my c++ program. I created a program that is much like the "Who wants to be a Millionaire" television show. It has questions and the right answers and three lifelines. How can I possibly do eliminate a lifeline after being used.? this is the program …

Member Avatar for WaltP
0
223
Member Avatar for fruymercado

[split from [url]http://www.daniweb.com/forums/post1162537.html#post1162537][/url] how can i create like that program but i need to have more questions and i dont nid to use the life time because lifetime is dificult so please help me or give me a program to use in our c++ subject here in MAPUA. please i …

Member Avatar for jhaiskie
-1
526
Member Avatar for endframe

Hello everybody :icon_neutral: I'm having an error in finding the biggest/smallest numbers in an array; the debug result gives me wrong numbers. Here's the code that I have been working on: [CODE]#include<iostream.h> int linearsearch(char b[],char searchkey, int size); void main(void) { const int arraysize=7; char a[arraysize],key; int result,i; int s; …

Member Avatar for WaltP
0
110

The End.