49,761 Topics
| |
I must say I always love a program where I can use #include<vector> vectors are like the peanut butter to my chocolate! | |
Following program gives me output 556 , I cant understand why ? [code] #include<stdio.h> main(){ int i =300; char*ptr =(char*)&i; *++ptr = 2 ; printf("\n%d",i); } [/code] | |
Have you ever had a problem where you are completely dumbfounded? Staring at the output of a program and saying this is impossible? Sort of like… int a =5; printf(“a=%d\n”,a); Output: A=6 Well, I’d appreciate if someone would take a look at this simple program below which creates a class … | |
Hello everyone, I`m new in this forum , and I`m an absolute beginer in C++ language. Therefor i already have some major problems in my learning. My compiler is giving me odd errors eventhough the codes are typed in corectly , exactly as in the book. Here are some of … | |
Hi people i need yor help. It must be easy for you but im starting with c++ and i can not figure put how to do this: I have two classes, each on with the .h and .cpp files and a main class that must call the objects created for … | |
Hi everyone i really need your help i need to write a code for a game in tow dimensional array [6][5] that 2 people are playing its like X O but the size is of the storck is decieded by them every player picks the colmun he wants to put … | |
Hello, Firstly I better warn you I'm quite new to C++ and to Linux so I'm sorry if my terminology/general understanding of how things work is a bit confused. I've downloaded a code which is in C which is helpful for a course I'm doing on stellar structure, but I'd … | |
Hello, I have a class with template argument, MyClass. Next I initiate 3 copies of that templeate class with different types : [code] MyClass<char> mc1; MyClass<int> mc2; MyClass<float> mc3; [/code] Is it possible in c++ to make a general pointer array with each element as reference to differenet initiated class? … | |
Hi, I am calculating arithmetic mean of some $ values, so my numbers should have dollar part and cent part ( two decimal points ) double x = 3.46; double y = 12. 13; double arithmeticMean = ( x + y ) / 2; //7.795...should be 7.80 I don't care … | |
hi guys now a day i work on project to create a menu bar in c++ so i feel to want help how to creat exect manu bar if any one have a code so plz share it thanks | |
first i copy an object byte by byte to a memory location . Then cast starting address of that memory location to pointer of object type and access member function of object using that pointer . code is very lengthy and split across files .. so i was avoiding to … | |
i want to connect my SQL server 2005 data base through c++ code.. please soem one help me.. more precisely, when ever there is a update in the data base i have to pass the values of the field to another application thru c++ code.. | |
Write a short program thats reads a file called text.txt that replaces all words that begins with the letter f and is replaced with the word frog. Now i have a jeist of how to replace words with another word however i am unsure how to find words only starting … | |
hi everyone, I was practicing binary search with array and encountered a problem. My code works but I can't help to make one part of it better. Well look at my code to understand my question better. [code] int binary_search(int arry[], int size) { int first = 0; int last … | |
I know how to draw PNG in my dialog using OnPaint() but i don't know how to draw a PNG after i click a button. Here's the code for the OnPaint() that i use [CODE]#include <gdiplus.h> #pragma comment (lib,"gdiplus.lib") using namespace Gdiplus; ... all MFC stuff void CAppName::OnPaint() { CPaintDC … | |
Dear All Although my tutor said that it takes 25 minus, I have been trying to understand for more than a week that how to do my task. I have done something as you said before in terms of "putting at least some efforts". Please see the codes below and … | |
I was writing a simple class to test my understanding of class and the first class program had a number -int num private- that was modified by the user by void definenum(num) and retrieved with int getnum(). It functioned as I expected-i would define it as 4 and it would … | |
Hi all there. Given the huge amount of blackjack/card games threads and me being personally interested in poker and other games, I was feeling like starting to play with a few useful (at least I hope so) classes for dealing (no pun intended :P) with card games. I started my … | |
i try to develop a make file and i got this error : Dependency line needs colon or double colon operator. my makefile is in this state yet: [CODE]Books.o: Books.cpp include/author.h include/Booksh.h include/library.h xlC -c SourceFiles/Books.cpp -l vista -L/sbx/asc/slib -I/user/serkans/myprog/BookLibraryTrial/include -I/sbx/asc/vista libMan : main.cpp cmnlib/libfoo.a xlC main.cpp cmnlib/libfoo.a -l vista … | |
I wrote a simple program to convert Roman numbers to Japanese (roomaji). This program needs to lookup a string using a number (think std::map). And I'm wondering about the pros/cons of the 3 methods I thought about: [B][COLOR="Red"]Method 1[/COLOR][/B] I guess the major con here is you need to initialize … | |
Hi, [I]I am newbie in C++. In a C++ Program[/I], i am getting error message as "[U][B]Double freeing of freed memory may be in class 'WSO'. copy constructor and operator= is not defined.[/B][/U]" I haven't defined any copy-constructor and operator overloading in Class 'WSO' (since i haven't use any assignment … | |
Hi Guys, I am a complete newbie to C++. I have a background in R, and have recently taken the plunge into C++. Not having much success though. I am trying to solve an easy problem (no doubt) - reading data from a tab delimited file and inserting it into … | |
I'm trying to display some object information and it seems to work when I use a pointer to the object, but not when I pass the pointer to a different function. Hopefully, the code will better explain: [CODE] struct pcb { int pid; string name; } void showData(pcb* PCBobject) { … | |
I am developing a windows form application , can any one explain the basic structure of the program and how to do the basic things like calling functions for a event, opening a form on button click on main form. | |
I have a file with record times, i need take each time and compare it whit the actual player time, so if the player time is < then the best time:input player time on top, if is >, then compare whit the next time and so... the problem is until … | |
[code=c++] class tvShow { public: string name; string dayofweek; int lengthInMin; double rating; } [/code] write a sequence of statements that will do the following: If the show is scheduled for wednesday and the rating is above 20, print We Have a New Hit Show. if this is not true … | |
I use this code to open a FileDialog, choose a file and press OK. It works fine, but when I press OK in the fileDialog, the FileDialog doesn´t close after pressing OK the first time. The dialog blinks one time and are still open. The second time I press OK, … | |
i got one root folder containing my main.cpp and four folders named cmnlib(for static library), include(for headers), sourcefiles(.cpp), dbdes(mydatabase). i want to create a make file and it will first create object files from the .cpp files into sourcefiles folder and then it will create a libLibrary.a to cmnlib folder … | |
After my searching and discussing wif my fren, to compare string i need to use strcmp but that is if i want to compare the whole sentence. What i want to do is like this: user input sentence 1: this is my house user input sentence 2: this is my … | |
Hi guys, I pretty new to c++ and I have a problem with getline. I am supposed to call in a text file into a 2d character array and the text file is a maze. Here is my code: [ICODE] void maze::open() { ifstream file; int row=0; file.open("standard.txt"); while (!file.eof()) … |
The End.