General C++ Programming - January 2009 (Page 7)

Resizing a Dynamic Memory Array
 
I've finally told myself that I'm going to learn C++, so I've been using the tutorials on the site, and they're great. I've run into just one problem that I ca...
[5 replies] Last: Well, you could line.push_back( string() ); getline( file, line... (by jsmith)
Error in Prime number program
 
Him, im writing a program that will determine whether a number entered by a user is prime or not. It tests the entered number by dividing all the numbers under...
[4 replies] Last: If you really want sqNum to be an integer, and don't care about los... (by scottwuzhear)
Memory leak?
 
Hello, I'm wondering about the best way to return objects in class functions. The code I'm posting is an overloaded + operator that adds two matrices (created w...
[2 replies] Last: jsmith, Thanks for your help! -gr (by geeare1)
cant print to screen
 
I have a basic Win32 dialog program that I need to turn into a command line program. I've got everything done, but none of the printf or cout statements are pr...
[5 replies] Last: Somewhere at the beginning of your WinMain() call AllocConsole (). ... (by Duthomhas)
by Ruben
why memcpy inverts the byte order?
 
Hi all, I'm trying to use memcpy to get some kind of information copied into a buffer. My problem is that the order of the copied bytes seems to be inverted ...
[3 replies] Last: Thanks to you both for your explanations! I guessed it was a questi... (by Ruben)
by guykun
textBox .Text Reference
 
Hihi, I'm trying to simply set the text within a textBox that I have drawn onto a 'Form1' Visual C++ I am currently trying to use the line: NarakunoKyokai:...
[11 replies] Last: It's not the best but you should see where this go. http://msdn.micro... (by closed account z05DSL3A)
Problems creating a dll
 
Hello! I have a .dll that I debug on my Computer. Now I want to use it on another PC. But copy and paste doesn't work, because as soon as I try to debug the ...
[no replies]
C++ Hexadecimal Problem
 
I need help about the following: I have a file that contains two bytes: 1B and 6A. I am using Microsoft Visual C++ 2008. My program reads the two bytes fr...
[2 replies] Last: Thank you very much for the code. It works and I found it really usefu... (by kikolani)
Problem with file output
 
Hello everybody, here is my problem i have some file which contain random data for example: sadasjdgjdsdfsdffsdsasdrgfsdfjdfjkbdkjf .... how i can i...
[2 replies] Last: No, there's no other way. The only file operations are clear, append,... (by helios)
searching an multi array
 
getting a c2679 error with this function. [code=c++] int arraySearch(const string& name,int& numNames,const string secArray ) { int index = 0; bool fou...
[3 replies] Last: thank you so much you just help me get out of a 6 hour problem.... but... (by dvsConcept)
shift operation in C++
 
I found something unexpected about shift opeartion in C++ when I was solving my bug, as the following I tried to shift an unsigned int var: int ret = 0;...
[4 replies] Last: As Grey Wolf referenced, when overflowed, the behavior is undefined. H... (by KenSoGCN)
how to pause screen
 
Ok, so i compile a program under dev cpp, input the values but the screen vanishes the moment i hit enter. i recall there was a method to pause the screen so u ...
[1 reply] : Read this: http://www.cplusplus.com/forum/beginner/1988/ (by Bazzy)
Magic square problem C++? ?
 
Magic square problem C++? ? how do i make program in which computer tell me what are the perfect squares. Ex. 6^2 = 36 which sum of 1.. to.. 8 = 36 how d...
[2 replies] Last: umm if I get what you're asking you can use a simple loop where you mu... (by Malachi)
Overhead of functions
 
What is the performance impact of using functions in a program to help clean up code. Aside from the benefits of being easy to read, debug and maintain, are the...
[12 replies] Last: For now it is easier to leave everything in the main function. Once I ... (by jwoolsto)
plz answer or belp me in my problem
 
i have aproblem in this tow program if u can help me show that my first programme 1- by using dynamic pointer make aprogramme to input n integer data ...
[2 replies] Last: First try doing your assignments by yourself, then ask for help if you... (by Bazzy)
by xanmas
Global Variables
 
Hi, I have a program that has t declared as a global variable with double t; //the time variable . Well, That is initialized to zero by the method, init();...
[4 replies] Last: What do you mean by using a class? All the variables that I have de... (by xanmas)
best practice - where and how to declare constant multi-hash
 
I'm a relative c/c++ newbie and this is 'the best practice' question. I need to define a number of job categories (arts, education, engineering, leisure and...
[4 replies] Last: Excellent - thanks for that. That's what I wanted to know. (by xfurrier)
by Tracks
Working with a virtual barrier
 
Hello all, first time poster here with a pretty general question. I apologize if it has been asked before, as I did look around before posting this. I am work...
[7 replies] Last: I came up with a bit of an odd idea, but I think it might just work. A... (by Tracks)
stacks in maze
 
Im a noob in c++ I dont know how to use stack in this maze?,the stack will be the one who will store the paths and I want the program to not use recursion,how ...
[4 replies] Last: ok thanks for the idea,I got it all covered right now. (by acedman)
saving 12 bits data
 
Hello everyone Happy new year! Here is my problem: I have 2D images where each pixel data is stored in an unsigned short (16bits) but the information in the ...
[5 replies] Last: I would prefer to keep 4 bits of chunk1 as LSB and chunk2's 4 bits as ... (by maxchirag)
January 2009 Pages: 1... 56789... 11
  Archived months: [dec2008] [feb2009]

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