49,761 Topics
| |
u ask user for the filename and then u read the the file, display it into an array assume file contain only numbers with that u display data such as total,average,highest number,lowest ect.. my question is how would u determine the size of an array to work with?? given the … | |
Hey. I am wanting to make this program so that the user can move the position of his characters. I have made a attempt but i am confused about some bits. [CODE=C++]// Code Shark #include <iostream> using namespace std; int main() { char character = 'X', movement; do { system("Cls"); … | |
How in the hell do you divide by 7 using nothing but-- ~, ^, >>, <<, &, | -- In a set algorithm. I'm stumped. I've tried mapping out different numbers dividing by each other... it didn't work. I would map out a number subtracting from the other to see … | |
how would i write code so when someone enters 1 charcter it changes it to somthing else for example if someone entered 100 / 5 it would say 100 รท 5. | |
I've been getting an "Access Violation" error while running this program: [code=c++]#include "SDL/SDL_ttf.h" class Font { private: TTF_Font *font; public: Font() { font = TTF_OpenFont( "c:\\windows\\fonts\\cour.ttf", 20 ); } ~Font() { TTF_CloseFont( font ); //Access violation } }; int main( int argc, char *args[] ) { if( TTF_Init() < 0 … | |
Hey i have a few random questions that i can't seem to get my head around at the moment. Any help would be appreciated 1) What criteria would you apply in deciding which of the three forms of loop to use in a program? 2) What does this function prototype … | |
Hello, I made this program that has random values and you have to choose to say if the next number will be higher - or lower. I completed the code and successfully had no errors but when the user is mistaken nothing comes up. Am I missing something? [CODE=C++]// Code … | |
Board.cpp: [CODE]#include "Board.h" Tetris_::Board::Board(int b, int h) { width_ = b; height_ = h; } ostream& operator<<(ostream& out, const Tetris_::Board& brd) { out << "(" << brd.width_ << ")"; return out; } Tetris_::Board::~Board() {}[/CODE] Board.h: [CODE]#include <iostream> #include <stdlib.h> using std::ostream; namespace Tetris_ { class Board { public: Board(int b, … | |
Hello :) Umm I have a small question :) Which do you recommend for fast searching BST or AVL tree? My answer: It might be the BST because it'll be noticed that in the right subtree all the numbers greater than the root will be there also for the smaller … | |
Hi, I was wondering with the menu bar how to open, save and make a new file on the menu bar [code] case MENU_FILE_ID_OPEN: { //something to open the file } break; [/code] i have no idea at all how to do this, i have searched the net but it … | |
I'm writing a function that reads an IP address from input and generates its 32-byte values. If the input is correct, the whole thing can be done by this: [CODE=C++] int a, b, c, d; char buf; cin>>a>>buf>>b>>buf>>c>>buf>>d; ... [/CODE] If it's not, such as 256.0.0.0, or 1..2.3.4, I want … | |
[B]Array.h CLASS[/B] [code=c++] #ifndef __ARRAY_H #define __ARRAY_H template <typename DataType, int size, DataType zero> class Array { public: // set function, sets an index void Set(DataType p_item, int p_index) { m_array[p_index] = p_item; } // get function, gets the index DataType Get(int p_index) { return m_array[p_index]; } // clear function … | |
if you use movefile and ofstream the ofstream file won't be made.. :s any way to solve this? | |
Hello, I tried posting this earlier but i do not think it went through because my internet connection was cut off. In case it did i am sorry for the repeating it, but have not seen it on the site. Any ways. I am writing a class program and i … | |
Hello everyone, I'm learning programming for the first time and my first book i bought from the book store is the new Deitel C++ 6th edition. After reading the first several chapters I got so overwhelm with the authors verbose; I went out and bought C++Primer. One thing I noticed … | |
Hi, I am trying to write a class that uses vectors that contain another class. When I compile my code using g++ I get the following error that I don't understand: [B]In file included from cars.cpp:5: car.h:24: error: syntax error before `;' token car.h:25: error: syntax error before `;' token[/B] … | |
well in a program i m making i need a loading screen it wont be doing anything its just a prank thing im doing but i need like it to sit and look as if its loading for half a minute can anyone help im in the dos box still … | |
Hi, Iam very much new to programming and C++ please help me I have an application that uses socket++ classes on Unix (AIX) environment I have included #include<sockinet.h> in two of my .cpp files and I have socket++ source in my temp directory when iam trying to compile my application … | |
Hi everyone, I've written a test program, and I need help limiting the amount of characters a user enters in a char. I want it so that that maximum amount of characters is 1, and if they enter more than 1, it will display a message. Here's my code: [CODE]#include … | |
Hay everyone, first time poster. I am designing a program in Visual C++ 2008 Express Edition and i need the following code It is a console app. I need code to beable to create a directory on drive C. I also need some info about how to copy the programs … | |
Hi, Being someone who is now working with C++ but initially started with Java, I am experiencing some problems seperating my classes from the main file. So I want to seperate the following simple class into it's own standalone C++ file so I can use it with multiple programs: #include … | |
hi friends, I want to calculate the amount of heap memory at runtime at any point in the program. how do I do this?? do we have a function for it. Thanks, himanshu k. symbian application developer | |
The following is giving output as follows String:Astro.cfg Fail If buff is Astro.cfg, it has to give success output, but it is giving fail. I want to print Success.. Please guide me regarding this pointer usage.. [code] #include<iostream> using namespace std; int main() { char arr[]="Asto.cfg"; char *buff=&arr[0]; printf("String:%s",buff); if(buff=="Asto.cfg") … | |
Friends can i return a list or a map from a function??? | |
I'm using CInternetSession and CFTPConnection MFC classes to put a file to an FTP server. However there is an intermittent problem showing up where the file appears on the remote server as incomplete, missing the last couple of hunder bytes. The CFTPConnection.PutFile() returns success, indicating that nothing went wrong even … | |
The problem I need to solve is: create a multitude of Stacks with different types of data. And what makes it difficult for me is the following: In the multitude there should be all sorts of data stacks. Would it be stacks with integers, chars, objects from user defined classes … | |
I am trying to get quite a large number 0.00012354684 to X required decimal places. Using <iomanip> and setprecision() but I cant seem to get it to work. Could someone please give me a small example. Thankyou, Regards X | |
Well I am going to try and make an anonymous emailer using C++... I would like to use this to learn how to send commands to a command prompt or something like it because the normal way to do it through the the command prompt then telnet or netcat into … | |
I have 8.5 million combinations which are then put through 30 if statements. Then final output. Now I havent tried this yet BUT I dont think php will let me make a 8.5 million length array nor will C++. So what else can I do? Are there any other lanuages … | |
Is it possible to get the local time of a machine ( i can do this part ) then generate a random number between 1-5 ( i can do this ) then add the two together then execute a file when that time comes. Like: Local Time: 10:05 Random Number: … |
The End.