49,761 Topics
| |
Hey all, I am continuing with my self study and now I have come across classes. I have read about this and read about this but it seems very alien to me.The problem I have selected to do is as follows: Here is a rather simple class definition: [code=c++] class … | |
It is late here, I am tired. I know this is probably out there somewhere, and that I am not showing effort by not looking for it, but I really am too tired, so tomorrow morning if this is answered (takes you like 2 seconds to answer it) I'll mark … | |
hi I am trying to write into a file which already has something in it. like for example i have x y z in the file and if i want to put k after x,y and z like x y z k. my code goes this way [code=c++] int main … | |
i would like to create a program that converts a number system to another i found few ideas on how to do this but lacks explanation so i can't figure out 'how it worked'. found that 'for loop' over the net,did some editing then applied it in a program. here's … | |
hi. i'm planning to use visualc++ as the language for a pcb layout artist/designer. i'm wondering if it's possible to create a command line interface (just like in AutoCAD) using visualC++. | |
Could please help me in the code,of how to extract the no of words in each sentence(if there are 2 or more sentence).But i want the code to use string function????????? | |
here's my code: [code=c++]cin>>figure; switch (figure) { case '1': //figure is circle system("cls"); cout<<"input radius: "; cin>>rad; cout<<"\nsurface area of your circle is "<<pi*rad*rad; break; case '2': //figure is rectangle system("cls"); cout<<"input length: "; cin>>length; cout<<"\ninput width: "; cin>>width; cout<<"\nsurface area of your rectangle is "<<length*width; break; }[/code] 1)when i … | |
I want to send data(image and vedio file ) from client machine to server , I am having a url "http://localHost/prabhat/vedioolad?vedio=&image=" how to send the image and vedio file through this url in VC++ | |
Can somebody help me with this code. The program need to repeat until the user wants to quit. [code]#include<conio.h> #include<iostream> #include <cstdlib> #include <stdlib.h> using namespace std; int opcio1(); int opcio2(); int opcio3(); int main() { int choice; cout << "==========================================" << endl; cout << " Menu" << endl; cout … | |
Hi there! I'm having a homework problem, but it's with the header code I was provided in the text. When I try to use it, I get "name lookup of 'x' changed for new ANSI 'for' scoping using obsolete binding at 'x'" Did I do something wrong? Or is there … | |
can anyone help me on how to make this program short? what this program does is that its Initially on : R=1x1 off to the right, L=1x1 off to the left, G= night rider one cycle, S= off. This kind of program is made to control a micro controller...i need … | |
Hope someone can help. I'm self-studying from C++ Primer Plus, 5th Edition. I'm having trouble working out why the following two files will not compile. I'm using Dev-C++, under Windows Vista. [code="cpp"] /* Name: bankaccount.h Copyright: Author: Steven Taylor Date: 28/01/08 14:04 Description: C++ Primer Plus, Chapter 10, Programming Exercise. … | |
i hava a data student id examcode 1 002 006 001 2 123 589 How to store data when it have two data in 1 foleslike above? in .txt ot .cpp? and how can c++ called the data? | |
Hello, I'm trying to write a conditional IF statement for my program. What it's supposed to do is allow the user to enter numbers at random, but it cannot repeat any numbers. [ICODE]#include <iostream> using namespace std; void main() { int a; int b; int c; int d; int e; … | |
Ok so Im onto my next step.. Ive used c++ to read in an entire file, and got what I needed. The last and final step is to send the information in an email via my already setup outlook account. The below code works, and I dont know jack about … | |
Ok here is what I am trying to do at work as it's slower than a turtle in a race right now. I have a log of text guessing about 40 lines total. the last three sentences are what I am after .. being 38,39,40. I need to be able … | |
Hello everyone, im new here and a very noob programmer..I dont have mastery of programming and i find it very hard even the simple ones. Anyway, i need help in this program. Our professor asked us to program a simulation of soccer robots. What we are about to do is … | |
I am not sure if I am doing this assignment correctly, here is what it asks and the code that I have. I am not sure how to do the main to meet the assignments requirements. Any suggestions/advice are appreciated. > a. Create a function template called average(). It will … | |
I am tring to set an array with its values to zero within a constructor, but I can't get it to work. I have created an array with the size of 5 in the private of my class. I want the values of my array to be set at zero. … | |
Hi, I need some help with an assignment. Got some problems with my while loop. Can't seem to figure out what's wrong with it. [code=cpp] #include <iostream> #include <string> #include <bitset> using namespace std; int last (int num) { int l; l = (num % 10); return (l); } int … | |
Hi, i have been trying to do the following problem for homework, ialthough i have been able to input some code using the psuedocode given to me im am completely stuck now, and i was wondering if anyone could show me what i am missing? Question Use a single-subscripted array … | |
Hehe. I tried googling this, but all I've come up was Visual C++ results. How would I go about reading from a VERY VERY basic ini file in console C++ Using DevC++? The only things in the ini file are: b=65.0 c=1.5 k=1.65 I'm linking to this ini so that … | |
I'm trying to devise some base classes for a large system So why doesn't this work? [CODE=cpp] #include <iostream> using std::cout; using std::endl; #undef GetObject class IObject { public: IObject() { References = 0; } unsigned int GetRefCount() { return References; } private: protected: unsigned int References; friend class CHandle; … | |
We are being introduced to ADT's with type LIST. I initially thought LIST was included in some C++ library with predefined functions such as .insert(), .retrieve(), .getLength(), isEmpty() and so on. I now suspect this is all created by the programmer with classes and header files........which we'll cover shortly. Confused … | |
ok, i have a question say i have a class that wraps all file accesing functions ( basicly opening, reading and closing ) all these file handling functions throw a FileException exception i have a try block in that i open, read and close my file using the above mentioned … | |
Good evening ladies and gents, Had a question concerning this piece of code that I'm trying out from a book, it supposed to open a file, write text to it, close it, reopen it, append text to it and then write the text from the file to the console screen, … | |
Here is my code: [CODE]int LoadVerts(char *s_fName, OURCUSTOMVERTEX *p_Verts, short *p_Indices) { long i_CountVerts; long i_CountInds; unsigned char buffer[sizeof(OURCUSTOMVERTEX)]; basic_ifstream<unsigned char> f_DataFile; f_DataFile.open(s_fName, std::ios_base::in | std::ios_base::binary); f_DataFile.read(buffer, sizeof(long)); memcpy(&i_CountVerts, buffer, sizeof(long)); f_DataFile.read(buffer, sizeof(long)); memcpy(&i_CountInds, buffer, sizeof(long)); if ((p_Verts = (OURCUSTOMVERTEX *)realloc(p_Verts, sizeof(OURCUSTOMVERTEX) * i_CountVerts)) == NULL) exit( 1 ); if … | |
Hi to all. I need help. Quick and easy question. Is it possible to randomize and than delate stream of character pairs(one by one) from the input file? How can I do that? The input is a stream of character pairs that represent playing cards. For example: 2C, 3H, JH... … | |
Can anyone tell, how can i write that program in C++, its little bit Object oriented programming related... but i really need to develop logic in C++ Here is the statement: Write three classes names: circle, square and triangle, derived from class shape. Write down a function named intersect in … | |
[CODE]#pragma once class Account { public: //default constructors Account(); //constructor Account(double newSavingsBalance); //Methods //double MonthlyInterestRate(); //double newBalance(); void getMonthlyInterestRate(); static double AnnualInterestRate(); static void ModifyInterestRate(double newAnnualInterestRate); void setSavingsBalance(double newSavingsBalance); double getSavingsBalance(); double getAnnualInterestRate(); public: ~Account(void); private: double SavingsBalance; //static double AnnualInterestRate; };[/CODE] [CODE] #include "StdAfx.h" #include "Account.h" Account::Account(void) { } … |
The End.