49,761 Topics

Member Avatar for
Member Avatar for Manutebecker

I must say I always love a program where I can use #include<vector> vectors are like the peanut butter to my chocolate!

Member Avatar for Manutebecker
0
126
Member Avatar for rkumaram

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]

Member Avatar for rkumaram
0
90
Member Avatar for Frederick2

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 …

Member Avatar for ArkM
0
216
Member Avatar for bill2

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 …

Member Avatar for bill2
0
182
Member Avatar for fedderico10

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 …

Member Avatar for Lerner
0
169
Member Avatar for boomtoom

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 …

Member Avatar for cikara21
0
157
Member Avatar for arunciblesp00n

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 …

Member Avatar for ArkM
0
5K
Member Avatar for skalber

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? …

Member Avatar for ArkM
0
136
Member Avatar for suljo2

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 …

Member Avatar for ArkM
0
142
Member Avatar for kashif85

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

Member Avatar for William Hemsworth
0
52
Member Avatar for gumber

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 …

Member Avatar for gumber
0
162
Member Avatar for debonair

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..

0
73
Member Avatar for ecentric

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 …

Member Avatar for ArkM
0
2K
Member Avatar for mrnutty

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 …

Member Avatar for Jacky1
0
128
Member Avatar for I_want_to_lean

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 …

0
50
Member Avatar for ademsaykin

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 …

Member Avatar for ademsaykin
0
295
Member Avatar for CPPRULZ

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 …

Member Avatar for CPPRULZ
0
143
Member Avatar for mrboolf

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 …

Member Avatar for Murtan
1
523
Member Avatar for serkan sendur

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 …

Member Avatar for daviddoria
0
1K
Member Avatar for dewyatt

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 …

Member Avatar for dewyatt
0
288
Member Avatar for majesticmanish

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 …

Member Avatar for dewyatt
0
2K
Member Avatar for 1bennyd

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 …

Member Avatar for 1bennyd
1
244
Member Avatar for mesnomer

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) { …

Member Avatar for ArkM
0
82
Member Avatar for Naveen_bij

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.

Member Avatar for death_oclock
0
91
Member Avatar for Icebone1000

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 …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for jimbob90

[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 …

Member Avatar for ArkM
0
261
Member Avatar for Lukezzz

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, …

Member Avatar for Lukezzz
0
125
Member Avatar for serkan sendur

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 …

Member Avatar for serkan sendur
0
100
Member Avatar for Onizukas

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 …

Member Avatar for Lerner
0
77
Member Avatar for Yuichi

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()) …

Member Avatar for Yuichi
0
177

The End.