General C++ Programming - February 2011 (Page 16)

type-length-value question
 
Does anyoe have any example c++ code that is used to parse type-length-value messages. The only decent article I can find on the web is: http://en.wikipedia...
[no replies]
by clros
Fstream and simultaneous I/O
 
It is possible create a stream (fstream) to read data and then write other information without close the stream? I use fstream("miFile",ios::bynary) (or fstr...
[2 replies] Last: As far as I know fstream is actually intended for read + write combos.... (by simeonz)
by sittan
transform the expression...getting wrong answer
 
The question is : Reverse Polish Notation (RPN) is a mathematical notation where every operator follows all of its operands. For instance, to add three and fou...
[1 reply] : I am sorry, but I don't understand your code. I don't see the connecti... (by simeonz)
BINARY FILE READ>> DEBUG ASSERTION FAILED..
 
I'm trying to compile this code, and I get a pop up on my screen saying something like this: ************************************* DEBUG ASSERTION FAILED! ...
[3 replies] Last: Do you know how to use fstreams? If you don't, go look it up. After th... (by firedraco)
Timing a Bubble Sort
 
I have to time how long a bubble sort takes and print how long it took. In my program the time printed is always 0.00 seconds. Can anyone tell me what I'm doing...
[2 replies] Last: you can use clock_t then divide the result by CLOCKS_PER_SECOND th... (by closed account zwA4jE8b)
XBox 360 Controller Input?
 
I like to play COD: Black Ops zombies with a huge play list of music in the background and sometimes a lame song will come up. Minimizing to change the song tak...
[2 replies] Last: http://www.toymaker.info/Games/html/xinput.html (by quirkyusername)
making a dictionary program
 
Hi, i'm making a program to develop a strong vocab. How would I go about storing the words? I was thinking that using a lexicon. This text document lexico...
[3 replies] Last: Well, although map is sometimes called dictionary (as in translation d... (by simeonz)
Variable size parameter
 
I had a really cool idea today, but I can't get it to work. I'm trying to make a class similar to va_list, but it stores the number of variable arguments pas...
[8 replies] Last: I understand you have given this some thought. I'm not going to preten... (by simeonz)
how to swap in doubly linked list
 
Hi guys, how ya doing. Here I have a small problem with my doubly linked list. The thing is that I am trying to do in the pasted code below is that, I am trying...
[1 reply] : [c ode] "Code tags, please" [/co de] How do you expect that data ... (by ne555)
Class declaration of "More Effective C++", Item 30
 
After reading the item of the book, I am trying to implement it. However, there are only four lines of code in the book (lines with comment // book). I added ot...
[2 replies] Last: Alternatives to the default constructor: //Array1D** m_2Darray; m_... (by ne555)
Exception handling with STL Vectors
 
I have been facing problems with the programs crashing, due to accessing wrong index (out of range index). Just now checked that vector::at is the best me...
[16 replies] Last: Ok, I have one that works (in simple cases)...if you run it through a ... (by moorecm)
unordered alternative to next_permutation()?
 
Hello! Forgive me if anything I say is dumb, I'm a fairly novice programmer. Currently I have a vector of objects and I am permuting the vector easily with ...
[16 replies] Last: Here is another attempt. Green teases my eyes, so I'll explain the ide... (by simeonz)
how to add variables in C++
 
so if you run this code you will be presented with a few options and select one and then another and another and so on after you pick 4 the total calories are s...
[4 replies] Last: Try using STL and reduce the number of logical operators. Try somet... (by CppSpartan)
by Smitty
C++ Algorithm.
 
Write the steps to follow (an algorithm) to read in ten whole numbers and to output the sum of all the numbers greater than zero, the sum of all the numbers les...
[4 replies] Last: Try use ++i (pre-increment) instead of i++ (post-increment) it makes ... (by CppSpartan)
by SjL721
Removing a char
 
I have a string which is string s = "Hello:Brave:New:World"; We are supposed to used a while loop to make a new line where ever there is a ":" and then rem...
[5 replies] Last: Thank you Grey Wolf. (by SjL721)
vector.push_back(string) Doesn't work???
 
Hey there, I got a problem with the push_back function of a vector to fill it with strings. This is the code: labelVector.push_back(labelString); lab...
[3 replies] Last: Of what type is labelString ? char *labelString; // Is it... (by closed account zb0S216C)
by satya
fgets, getline problem
 
I have a program which takes the input from file which have 2^20 lines. It throws error after 1000082(for fgets) 1000000(for getline(fp,str)) line it throws s...
[1 reply] : If you have a memory overrun in some other piece of code, it will have... (by kbw)
by teppel
How to use unsigned char data type in this class
 
/* * Header file for the C++ ICE encryption class. * * Written by Matthew Kwan - July 1996 */ #ifndef _IceKey_H #define _IceKey_H class IceSub...
[15 replies] Last: Sorry ... have to post in 2 thread otherwise it show me error pri... (by teppel)
Selection menu with case and break commands
 
Hi all, i'm trying to've this program to display a selection menu but i keep having this error "initialization of RESULT is skipped by case label" Can someo...
[4 replies] Last: i try ur suggestion but it's still not working, cin.get () alone is wo... (by akounga2000)
shutdown program and close console window
 
Hello, I want my console application to close instead of returning 0. How do i close the console window, not hide it, but actually close the program? Thank you ...
[2 replies] Last: The existance of the console window is unrelated. If Windows spawns... (by Duthomhas)
February 2011 Pages: 1... 1415161718... 25
  Archived months: [jan2011] [mar2011]

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