General C++ Programming - December 2012

strchr and CString FIND
 
can someone covert this code that uses STRCHR m_filename[strchr(m_filename, '.') - m_filename] = '\0'; into code that uses FIND of CString ...
[1 reply] : I think that equivalent code will look as m_filename[m_filename.find... (by vlad from moscow)
Strange bug in Release mode
 
I am using VS2012. I have a bug in my code that i don't know how to overcome as it appears in bizarre situation. It works fine in Debug but crashes in Release m...
[5 replies] Last: "Clean" then "Rebuild" and now it works. (by morando)
by m1m6
problem if finding postfix
 
hello my code convert some expression correctly and other not.. Ex:(2+7)*6 RESULT:54 TRUE BUT 1*4+4*0-3 RESULT:1 but my code out 7 here is my code const ch...
[3 replies] Last: I would start by insuring your if/else clauses are correct. I suggest ... (by jlb)
Looking for multithreading method and tutorial
 
Hi, As you might have seen in the title, I'm looking for a good multithreading method and corresponding tutorial. I've searched the web, but there is too muc...
[7 replies] Last: multithreading is a sexy clunky way of handling problems: #includ... (by DeXecipher)
what does this code do
 
This program is supposed to move itself to to C:\\Windows\\projekt1.exe if it isn't allready there. Then it shall write a registry value if it is not allready w...
[no replies]
Help with checking 8086 emulation opcodes?
 
I'm currently writing a x86 emulator (8086&80186 implemented atm). It seems that MS-DOS still won't run. Anybody knows which opcode(s) is/are wrong? Currentl...
[no replies]
Produce a program which demonstrates ..
 
hey guys does any one know how can I Produce a program which demonstrates the use of a user defined function called incrementInteger which when I pass an intege...
[6 replies] Last: ->softwareStudent(14) read this link: http://www.cplusplus.com/doc/tu... (by Kart)
How we can write this function?
 
write a function that accepts a train code of type character (lower or upper case)and returns the correct sponding train type to the following table. Train c...
[1 reply] : #include <cctype> std::string TrainType(char t) { t = toupper(t); ... (by Stewbond)
std::unique_ptr array specialization
 
How come it works without being given the deleter? The second template parameter, Deleter , isn't defaulted. http://en.cppreference.com/w/cpp/memory/unique...
[1 reply] : > The second template parameter, Deleter, isn't defaulted. It is. /... (by JLBorges)
Explain this output of this program.
 
#include<iostream.h> #include<conio.h> void main() { int x ={1,2,3,4,5}, y ={5,4,3,2,1}, result ={0,0,0,0,0}; int i=0; while(i++<5) result =x -y ; clrsc...
[1 reply] : int i=0; while(i++<5) result =x -y ; Iteration 1: whi... (by cire)
by xzbit
icon changer
 
i cant make it to work, it only change the icon to default can anyone help me ? thanks in advance DWORD read; DWORD dwSize; char* buffer; HA...
[no replies]
by kndmrl
help for reading from text file !!!!
 
I have to write a function which reads from a file and allocate it . if it is binary file open for binary or if it is text file function must open it in that wa...
[3 replies] Last: use a char, it works as well. For example: void /*function name*/(cha... (by SirSen)
Swapping objects
 
The reference on std::swap disclaims that it uses a copy constructor and two assignment operators which may not be the most efficient way to swap two containers...
[7 replies] Last: > a class containing an entire 15MB wave file would really just have t... (by JLBorges)
by pjesh
Canvas
 
Hey guys, I'm creating a program that essentially consist of a Canvas class that displays shapes (Rectangle & Square) inside it. The issue I have is, I ...
[5 replies] Last: If you want to create an image, there are no standard or library in c+... (by majidkamali1370)
Someone help me ! :(
 
i didn't know how to calculate the total hours and minutes of work... can some one give me advice? #include <iostream.h> #include <conio.h> #include ...
[11 replies] Last: shinkansen is right, try doing what he posted (by Antares64)
Creating a grid with totals
 
Hello all! I need some help with a project: The user enters 9 integers to fill in a 3 x 3 grid; determine the totals horizontally and vertically. For exam...
[7 replies] Last: Wow thank you! I changed my coding around a little bit. I just need to... (by cthulu1990)
rand()
 
After seeding random with time calls to rand are producing the same patterns of numbers on each exe Run 1 123 432 643 Run 2 123 432 643
[1 reply] : Code? (by Athar)
How to ask the user if wants to play again?
 
How to apply 'play again y/n' in simple hello world code. // Repeat Hello world, by // include the iostream library #include iostream //using the stan...
[7 replies] Last: @Suggs Couple of problems with your code: line 4: using namespace s... (by TheIdeasMan)
Static template class member question
 
Say you have a class template <typename T> class foo { private: static int bar; }; Is bar shared between all objects of type foo, or is it grouped s...
[2 replies] Last: Thanks. (by chrisname)
object oriented
 
I have a textfile which includes some features of an object. Namely, its name, its size, its age and so on. How can i read these infos from this text file an...
[1 reply] : http://www.cplusplus.com/doc/tutorial/basic_io/ (by Athar)
December 2012 Pages: 123... 43
  Archived months: [nov2012] [jan2013]

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