49,761 Topics

Member Avatar for
Member Avatar for hiddendragon

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 …

Member Avatar for hiddendragon
0
144
Member Avatar for Code Shark

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"); …

Member Avatar for VernonDozier
0
148
Member Avatar for Alex Edwards

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 …

Member Avatar for invisal
0
171
Member Avatar for wtf???

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.

Member Avatar for ctrl-alt-del
0
91
Member Avatar for Evan M

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 …

Member Avatar for Evan M
0
233
Member Avatar for Fault

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 …

Member Avatar for tecktalk
0
123
Member Avatar for Code Shark

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 …

Member Avatar for VernonDozier
0
142
Member Avatar for fittipaldi

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, …

Member Avatar for Narue
0
86
Member Avatar for Q8iEnG

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 …

Member Avatar for Q8iEnG
0
126
Member Avatar for 11silversurfer1

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 …

Member Avatar for 11silversurfer1
0
155
Member Avatar for lingol

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 …

Member Avatar for lingol
0
194
Member Avatar for GFXtm

[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 …

Member Avatar for vijayan121
0
444
Member Avatar for qeinar

if you use movefile and ofstream the ofstream file won't be made.. :s any way to solve this?

Member Avatar for qeinar
0
136
Member Avatar for nayrb

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 …

Member Avatar for AceofSpades19
0
135
Member Avatar for sftwr21

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 …

Member Avatar for Alex Edwards
0
392
Member Avatar for klactose

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] …

Member Avatar for Ancient Dragon
0
84
Member Avatar for justinclev

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 …

Member Avatar for 11silversurfer1
0
132
Member Avatar for vadan

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 …

Member Avatar for Ancient Dragon
0
74
Member Avatar for Wiki_Tiki

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 …

Member Avatar for Ancient Dragon
0
125
Member Avatar for DS_sniper

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 …

Member Avatar for DS_sniper
0
89
Member Avatar for bleh1318

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 …

Member Avatar for ArkM
0
106
Member Avatar for himsymcpp

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

Member Avatar for ArkM
0
2K
Member Avatar for ambarisha.kn

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") …

Member Avatar for CoolGamer48
0
83
Member Avatar for sangham
Member Avatar for bwspoon

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 …

Member Avatar for mitrmkar
0
93
Member Avatar for simeon.andreev

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 …

Member Avatar for simeon.andreev
0
119
Member Avatar for OmniX

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

Member Avatar for Nick Evan
0
114
Member Avatar for KenTheFurry

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 …

Member Avatar for Nick Evan
0
54
Member Avatar for OmniX

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 …

Member Avatar for Nick Evan
0
149
Member Avatar for FTProtocol

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: …

Member Avatar for Salem
0
81

The End.