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

by mIXpRo
c++ memory allocation
 
is there something similar in c++ to realloc in c ?
[4 replies] Last: You also have the allocator class although I'm not sure if that's what... (by tummychow)
Using 2 variable as conditions?
 
I just started C++ 1 week ago and i was wondering what is the correct syntax to use 2 variable as conditions for example: int main() { char Yes, No; cout<...
[6 replies] Last: @PanGalactic : THX!! That's exactly what i needed and also thx to all... (by Infernochaos)
by paul23
functors, and changin them "on the run"
 
Well let me first show the code: #include <iostream> #include <functional> #include <cmath> class generic_dis { public: virtual double operator() (const...
[3 replies] Last: Close but don't forget the reference/pointer part--it is the key. H... (by moorecm)
matrix looping//
 
i have this problem programming i dont know how to start,,, our teacher asked us to make a program that can solve n by n matrix..i guess we should use looping f...
[1 reply] : Use two nested for (by Bazzy)
by jonnyw
How to split a byte into bits so you can check whether bit X is 1 or 0
 
Hi everyone, Can someone please explain to me how can I split a byte into separate bits? I want to check whether a particular bit is 1 on 0. For example,...
[1 reply] : unsigned char byte = something; bool fiftDigitIsOne = byte & 16 // 1... (by Bazzy)
by jrohde
Thread Priority Question
 
Hello all, Just curious about the nature of thread priority. I currently use Win32 threads, but I suppose this would apply to any API or OS: In a file sp...
[4 replies] Last: 1. It does matter what priority your thread has. Does it? When all ... (by ktoto256)
by Nikhar
Suggest a good tutorial for graphs in c++
 
Hi... I'm trying to study graphs but I cant find a good tutorial on it. I googled it, but couldn't find what I needed. Can you please suggest me a good tu...
[1 reply] : Oh, btw I'm using XP and the compiler is Code::blocks. (by Nikhar)
reserve() in vectors
 
int main() { vector<int> v1; v1.reserve(100); } Does "v1.reserve(100)" above actually allocates memory for 100 integers and calls constructor o...
[3 replies] Last: Constructors are not called. (by helios)
by rey
source code assistance pls
 
Need your kind expert advice. I have to come out with a programme in C++ but I have no idea how to make it, really hope that anyone of you here can help me. the...
[2 replies] Last: ok noted. (by rey)
print empty screen when i compile.
 
Hello can some one help with this code . when ever i run this code it will print Teacher: press any key to continue..,, This is the code #i...
[2 replies] Last: As far as I can tell the code is working just fine, you're creating a ... (by Warnis)
by yag
Which C++ compiler to use?
 
I have Windows vista OS and i want C++ compiler to work with. Please suggest which one i can download ?
[13 replies] Last: Well if you are really serious try actually buying a piece of software... (by kevinkjt2000)
PCI Express I/O
 
Newbie here.. was hoping someone could give me some information on how to conduct reads/writes across a pci express interface to/from memory locations on a main...
[2 replies] Last: I'm not actually a C++ newbie, just a newbie to this forum :-P My exp... (by phaethon)
Creazy Behavior
 
Ok, this code is executes around 6 hundreds times at the start of the application, as it's related to a parser used by a group of classes when they are initiali...
[3 replies] Last: Just blind luck, I guess. Everything would work out fine if the next ... (by moorecm)
by gipark
memory problem on 3D array - segmentation fault
 
I want to make a big 3D array called u3d, so I declared it with the following sentence: nx=4096; ny=400; nz=129; double u3d ; C++ repeatedly give...
[2 replies] Last: Dynamically allocate the array. Depending upon the OS you'll have com... (by iharrold)
by Bazzy
Odd Constructor Syntax
 
I've found out that on g++ the following code compiles: struct Foo { ****const****const****& Foo() {} }; I can put as many * and const as I wan...
[4 replies] Last: I like playing with things ( until I eventually break them... ) So I'... (by Bazzy)
reading from ports.
 
Hello. What is "inport(int portid)" in conio.h ? How it works ? What is portid ? Thanks.
[1 reply] : Computers communicate with external devices (printer, keyboard, intern... (by Duthomhas)
conveting jpeg in memory buffer to bitmap
 
Hi all. I’m in a robotics program (FIRST Robotics) and my team’s robot has a webcam attached to it. Using the API provided by the FIRST organization that ...
[1 reply] : Hello slavik262, When working with webcams a very good library... (by Leomond)
.lib & .a extensions
 
Hello Does anyone know the difference between libraries with .lib and those with .a extension? I use Eclipse CDT for coding. A library compiled with Eclip...
[1 reply] : The .a is almost certainly a static library. It's a Unix convention. ... (by kbw)
TinyXML
 
I can't tell if I'm not getting the grand idea from XML or what but I'm confused as hell. I spruced up some code for one of my games to load through an XML conf...
[5 replies] Last: Look into boost::spirit. I'm pretty sure there is an example program ... (by moorecm)
by sebas
problems with calloc
 
Hi everyone! I'm trying to allocate memory for a matrix. I know the standard calloc use e.g double *Sigma=(double *)calloc(2*Nxfm+2*Nyfm,sizeof(double)); ...
[2 replies] Last: Thanks jsmith! Now I see the point. (by sebas)
January 2010 Pages: 1... 89101112... 17
  Archived months: [dec2009] [feb2010]

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