General C++ Programming - January 2010 (Page 8)

opening text files as binary files
 
say I have a text file (assuming it's stored in ASCII encoding which is 1 byte). Can I open it as a binary file and when I read each byte, I cast it into a cha...
[8 replies] Last: Oh, ok, sorry :) (by chrisname)
bubble sort method
 
Hi I'm trying to write a program that sorts an array using the bubble sort method. I was wondering how would I swap elements?
[9 replies] Last: Thanks you jsmith i figured it out and thanks to Bazzy and gcampton. N... (by coolProgramer5)
trouble understanding the c++ equilateral triangle program
 
can anyone please help me in understanding the equilateral triangle program? a few examples would be nice...
[8 replies] Last: i got it..thnx for the help #include<iostream> using namespace s... (by btk1000)
Statically linking libraries
 
OK, so when you complete a program and compile to executable, you can't just run it on other peoples' computers because they don't have the libraries. Some comp...
[18 replies] Last: Unless the linker is configured to remove unreferenced symbols, yes. E... (by helios)
Program Stops Working - Not Sure How to Fix it
 
Hi guys, I'm creating a blackjack game (for the final project of my c++ class), and it had been going fine up until now. I have three functions running ...
[5 replies] Last: I've been playing around with it a tiny bit, and here are my prelimina... (by Duthomhas)
how to reduce resolution of a .pgm file?
 
Hi if i have a .pgm file which has width and height of 1024x1024 now how do i write a program to read only the alternate pixels and reduce the resolution b...
[2 replies] Last: It would be just as easy to write your own pgm reader. The only "trick... (by Duthomhas)
by ratika
huffman coding
 
this is my huffman code but it is not giving the correct result as it should i mean i am not getting the whole right subtree from root for eg: if a text...
[3 replies] Last: in dis i m not getting the whole right subtree from root whereas i m g... (by ratika)
by CNoob
convert class A to class B without modifying A
 
hello all, I would really appreciate some guidance in a problem im in, and im sure one of you will know how to help :) first, lets say i have class A and clas...
[15 replies] Last: the program i am working on uses MFC (not mine - the companies). and ... (by CNoob)
reversing a string
 
I was wondering if it's possible to reverse a string?
[8 replies] Last: The standard library provides a function "reverse" to achieve an in pl... (by CorrodedCoder)
Looking to make a video game, Need a place to start, and pointers.
 
Okay, so I'm looking to make a video game. More precisely, to make a platformer. In an 8-bit style. A Mega Man fan-game. If someone could give me pointers, and ...
[2 replies] Last: Since you're going for platformer you'd probably be better off with SD... (by tummychow)
C code: how get IP adress
 
Hi all, can you help me to find a C code that retrieve IP address? I'm not expert programmer about socket and network. I need simple code that can get the e...
[4 replies] Last: Beej's guide is also very, very useful. http://beej.us/guide/bgnet (... (by chrisname)
palindrome
 
Hi i'm trying to write a program that checks whether a given string is a palindrome. And i thought of a way to do the program but there is one part that is conf...
[5 replies] Last: If you are not coolProgramer5 who just had this exchange: http://www.... (by jsmith)
Qn on STL multimaps
 
If I change the key of a multimap to another value, for e.g. iter->first = 80; Will the map be reordered such that the element I just changed would be place...
[4 replies] Last: Depends on what the type of the value is. Usually fragmentation isn... (by jsmith)
Visual Studio + include Statement issues
 
Just a quick question, I have a program I am making which uses source code which was written by someone else (legitimately I might add) anyhow it has the follow...
[8 replies] Last: iostream.h is a pre-standard header so on modern compilers won't work (by Bazzy)
weird error message (1,2)
 
I don't mean to double post but my last post was really long I couldn't stand scrolling any longer and this is a different question. Anyways when I run my progr...
[33 replies] Last: i figured it out. And thanks for helping. (by coolProgramer5)
Question about the boost::thread_group
 
I want to use thread_group for multi-thread, and maybe using it like this: void thread2(); void thread1(boost::thread_group& tg) { // create an othe...
[1 reply] : It would really help if you used code tags. I don't think that the ... (by PanGalactic)
trying to use system commands?
 
Hey, I am trying to make a brute force password cracker for an old zip file. (unzipping with PKUNZIP ver 1.1....its really old) I can already put together t...
[6 replies] Last: it's (pk)unzip it's a zip program much like winzip, 7zip, unzip. ... (by gcampton)
by erai
Not Animating
 
What Am i doing Wrong? Its Not Animating #include <windows.h> #include <math.h> __int64 Frame; __int64 FromStart; __int64 LastFrame; RECT rect; L...
[1 reply] : nvm fixed it (by erai)
Revision on failed assignment
 
This is a kinda long post, and I didn't want to post in beginners as I felt it didn't deserve the attention. This is purely for critiques or advice I guess. ...
[5 replies] Last: [quote=moorecm]What did it look like before? :P much much worse, a... (by gcampton)
Variable arguments, different types?
 
hello, can anybody tell me if stdarg.h supports variable list of arguments having different types? I saw a lot of examples where a function takes variable nu...
[4 replies] Last: Whatever it is you are doing, there is surely a better way to do it. ... (by Duthomhas)
January 2010 Pages: 1... 678910... 17
  Archived months: [dec2009] [feb2010]

This is an archived page. To post a new message, go to the current page.