49,757 Topics

Member Avatar for
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
154
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
442
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
135
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
133
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
131
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
124
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
87
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
Member Avatar for ravjot28

I made a project on telephone directory. I have used single class and my reading and writing in the file is done by fin.[write/read]((char*)&object,sizeof(object)); Now the problem is during searching a particular name or phone no. is just read the file and match the name or the phone no. in …

Member Avatar for Salem
0
82
Member Avatar for OffbeatPatriot

My project has gotten kind of big now but so I'm trying to post as little code as I can. It seems like the center of my problem is that I have a map for a game, at the start of this game the map is created and is constantly …

Member Avatar for ArkM
0
187
Member Avatar for qeinar

when i copy the file to the other directory i want the new file to be run instead of the file that i copyed there, i also want the first one deleated.. how can i do this? ^^

Member Avatar for qeinar
0
79
Member Avatar for 2fac323

I am posting this problem because I am a newbie to C++ and this program has me totally stumped. Any direction, advice, examples would be extremely helpful! I will try to explain my problem as well as possible- For research purposes and to better help students, the admission office of …

Member Avatar for Ancient Dragon
0
112

The End.