51,593 Topics
![]() | |
can u help me how to write the programing for this output? | |
Hello everybody. I'm new in C++ Builder and I have problem with my application. I have some files on input and first I add files in ListBox1. I try to sort them by 3 conditions (firts is date, second is some secc. number and thirt is const. number) for example … | |
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()) … | |
Can someone explain what the ShellExecute function is? Ive looked around a little, but there is nothing specific that i can find. Thanks | |
Hai everybody!I'm trying to implement a program to implement Quine McCluskey algoritm.While trying to compile with the following code,I got an error which says " no match for 'operator[]' in '((Table*)this)->Table::isMarked[r]' " . Attached are the files: Table.h,Table.cpp,Term.h,Term.cpp Please help!!! | |
hi guys I want help in solving this question the power series for In(x) ( 0<x<2) for up to 1000 terms is: In(x)=(x-1)-(x-1)^2/2+(x-1)^3/3-(x-1)^4/4.......-(x-1)^1000/1000 write the C++ code of the tWo functions GetValueofvar() and GetLogofVar(var) in the following main program: void main(){ double var; double x; var=GetValueofvar(); x=GetLogofVar(var); } where get … | |
I'm writing an application with Directx 9. Where I start the application in full screen mode, the image fills to fullscreen and then immediately reverts into a regular window. There aren't any problems when I run the application in windowed mode from the start. I was wondering if anyone has … | |
Normally I hate asking for help but this is an exception. I have spent hours looking for a way to detect in Windows if the sound card or windows audio is outputting sound. I am currently working on a project which is designed to save power. My sound card is … | |
Hi Guys, I'm trying to create my own DBMS. For now i want to create a simple one where i can 'create' tables, 'insert' data and do a 'select' for all values(no where condition as of now). Very basic features. This is the first design/pseudo code that i have come … | |
My problem: I made 1- A new MFC application (exe) (c++ .net 2005), dialog based. 2- Get from the toolbox a control which is "Picture Control". 3- Set the type of the control to Bitmap in the property window of the control. 4- Add new bitmap to the resources at … | |
[ICODE]//Deck Class #include<iostream> #include<stdlib.h> using namespace std; class Deck{ int Cards[51]; public: Deck(); void Display(); void Shuffle(); }; Deck::Deck(){ for(int n = 0; n < 52; n++){ Cards[n]=n; } } void Deck::Display(){ for(int n = 0; n < 52; n++){ cout << n+1 << ". " << Cards[rand()%51] <<endl; }} … | |
Hi, I have a problem because : this is my code [code] #include <iostream> #include <windows.h> // Sleep() #include <mmsystem.h> // mciSendString() using namespace std; // std::cout, std::cin int main() { mciSendString("open CDAudio", NULL, 0, NULL); Beep(440,1000); cout << "Opening CD-ROM door ..." << endl; mciSendString("set CDAudio door open", NULL, … | |
Hi, is there a socket library [B]besides WINSOCK[/B] that I can use with Dev-C++. I don't have a <sys\socket.h> include. Is there a devpak that I can get, or am I doomed to WINSOCK? | |
Hi, Im trying to write to specific points in a file, but the write() erases everything in the document..heres what im doing: the file: [CODE] mode 0 ; level 0 ; menu 1 ; [/CODE] the code: [CODE=C++] ofstream data_w_fil; data_w_fil.open("data.gsp"); data_w_fil.seekp(7); data_w_fil.write(mode, 1); data_w_fil.seekp(18); data_w_fil.write(level,1); data_w_fil.seekp(28); data_w_fil.write(menu, 1); [/CODE] … | |
Hello guys, I'm making a C++ project on periodic table.In that,i want to search for elements on the basis of their names in such a way that if i give an alphabet or more than 1 alphabets as the search value then all the elements starting from that letter should … | |
There are many new standards in C++ 2009 , but I don't know where the document or website about this is! Please help!!! | |
hi! i just have a brief question I couldnt find the answer for on the web. whats the access code for the mouse scroll click? as an example, if i would like to write an [B]IF[/B] thats cecking if the user has pressed the sroll wheel on his mouse, how … | |
Hi :) I have a problem. I have a class, called Sequence, which is a template. One of it's member variables is a vector or elements of type T. I would like to create a constructor which takes as it's argument an array of elements of type T and feeds … | |
Hi, I'm using WinSock, and am making a function to receive data. How can I know when I have reached the end of the data that I'm receiving. Like, if I send "GET /" to [url]www.google.com[/url] on port 80, I should receive the HTML of the index page. But in … | |
Hello all, I am just practicing on class. From what I have learned thus far (from the internet) I made a simple program that resembles picking a deck of cards. But my problem is that although it works. I cannot get it to generate different cards for each object. To … | |
deleting first element of an array.... deleting last element of an array... deleting middle element of an array... inserting first element of an array.... inserting last element of an array... inserting middle element of an array... searching the 2nd highest positive even integer thanks i need it... thanks |
The End.