49,761 Topics

Member Avatar for
Member Avatar for smeghead007

Ok what I need to do is utilize a binary search algorithm and determine the index location of a set of keys. The keys are in the file the user enters along with the numbers that have to be searched through. But im lost on how to do this. Do …

Member Avatar for WaltP
0
101
Member Avatar for zrd0808

Maybe I am missing something that is clearly obvious but I have fiddled with this printHelper and print function for a while and cant seem to figure it out. The rest of the program works and gets the correct code, but this does not. It should print out 1 -> …

Member Avatar for Lerner
0
92
Member Avatar for tennis

In the following program, why there is no delete in the destructor? is it because there is no pointer involved, so no memory needs to be released? How about the memory allocated when constructing M,P,S,N, the memory will be release automatically when the program ends? Thanks [CODE]#include<iostream.h> class point { …

Member Avatar for Fbody
0
240
Member Avatar for mrbright88

i am writing a program that is delcaring an array of 100 intger numbers and filling the array with random numbers us rand(). all i have so far is. #include <iostream> using namespace std; int main() { int random_integer = rand();

Member Avatar for vmanes
0
71
Member Avatar for rockingrakesh_5

i have written some code for class diagram generator for a segment of given code in lex and yacc...but to draw the class diagram i need to interface it with visual C++..is this possible?? hw can i combine lex and yacc with VC++??

0
52
Member Avatar for mduncan8

I have a compass that connects to my PC through RS232 @ 38400 BAUD. the compass outputs different "sentences" to send different kinds of data. Each sentence is a string that begins with a special header and ends with <CR><LF>. The string that I'm looking for is "$IIHDG,A,B,C,D,E*hh<CR><LF> where A, …

Member Avatar for mduncan8
0
157
Member Avatar for mazix2

Hi guys, I'm trying to implement Karatsuba multiplication in c++ using stl vectors. I have some problems with multiplication (addition and subtraction are ok, I've checked). I need to read data from the file, when the file looks like that: 3 // tells me how many pairs I have to …

Member Avatar for mazix2
0
1K
Member Avatar for tallygal

This program compiles and lets me select a letter from the menu, but then it just repeats the menu, it never outputs the statements that correspond with the letter chosen. Any ideas why? [CODE] #include <iostream> #include <iomanip> #include <fstream> #include <cstdlib> using namespace std; //Function Prototypes void accept (); …

Member Avatar for tallygal
0
268
Member Avatar for pumba

Hi all, I am tryin to differentate an equation and solve using C or C++. I need a start, n i m not getting much information from web even..I am curous hw MATLAB does that...i m positive that LAPACK has a no subroutine for differentiation. Appriciate your response Thank you

Member Avatar for Nick Evan
0
111
Member Avatar for lashatt2

I can inject dll in my compiled exe but dll loses his mind and I don't want it :( I use this commands IDR_DLL1 DLL "libmysql.dll" #include <tlhelp32.h> #define IDR_DLL1 128 HEAPLIST32 PE32; HINSTANCE hInst = (HINSTANCE) GetModuleHandle ( NULL); HDC hdc = GetDC(hwnd); HDC hdcMemRes = CreateCompatibleDC(hdc); HRSRC hRsrc …

0
62
Member Avatar for stricklypni

would the code below work for an hash table as in searching prior to inserting part... would it actually step through the table as in through the nodes then to whatever cells the nodes point to ... i have no other way of checking just yet .. coding still in …

0
44
Member Avatar for stricklypni

fatal error C1075: end of file found before the left brace '{' ANY IDEA WHAT MAY BE MY PROBLEM??

Member Avatar for stricklypni
0
105
Member Avatar for Pynolathgeen

My program keeps crashing when not in debugging mode. So now i'm debugging manually, or well, log everything to find where it is crashing [code=C++] Oldproc = (PROC)SetWindowLong(Childs[1], GWL_WNDPROC, (DWORD)EditProc); cout << "Oldproc\n"; SetFocus(MainWnd); cout << "SetFocus() Done\n"; cout << "DIRECTX:\n"; DirectX = new DIRECTX(); // Creating DirectX cout << …

Member Avatar for tetron
0
129
Member Avatar for heindrix_chenx

I’m writing a code on microsoft visual c++ 6.0 for load *bmp file and save it to *bmp file too. But i got stuck on save to *bmp code. Help me please.. void WarnaToRGB(long int warna,int *Red,int *Green,int *Blue) { *Red=warna&0x000000FF; *Green=(warna&0x0000FF00)>>8; *Blue=(warna&0x00FF0000)>>16; } long int RGBToWarna(int Red,int Green,int Blue) …

Member Avatar for Pynolathgeen
0
884
Member Avatar for tnecniv

Hi, is it possible to construct a pre order binary tree? i know how to do a pre order traversal. but constructing a binary tree using that i am not sure what it mean? what is the purpose of doing a pre order construction of binary treE?? please advise

Member Avatar for Mouche
0
80
Member Avatar for MrJNV

Hi, I have to do a recursive merge sort here. I got the merge sort done (thanks internet...because my book was useless), but I have to print the sublists as output. Here's the instructions: [COLOR="Green"]"The program must first display the list to be sorted. Then it must display the sublists …

Member Avatar for Mouche
0
233
Member Avatar for rkp728

I am writing a adler32 code to compute the adler32 checksum of a string. On the net I came across various sample codes: I did not understand some code entirely as <b>it has additional code</b> marked in bold below apart from the basic implementation of the adler32 logic. I did …

Member Avatar for rkp728
0
229
Member Avatar for jcps65

Hey Everyone, im struggling with this C++ assignment that my instructor assigned so i appreciate all the help that i can get. I have to read in the data from the text file and store it into parrallel arrays. My Text File looks like this: Darwin 103 04 20 2001 …

Member Avatar for WaltP
0
142
Member Avatar for LevyDee

[code] #include <windows.h> LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) { WNDCLASS myWindow; myWindow.cbClsExtra = 0; myWindow.cbWndExtra = 0; myWindow.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); myWindow.hCursor = LoadCursor(NULL, IDC_ARROW); myWindow.hIcon = NULL; myWindow.hInstance = hInstance; myWindow.lpfnWndProc = WndProc; myWindow.lpszClassName = …

Member Avatar for Ancient Dragon
0
84
Member Avatar for rizzi143

// hi guys actually i need some suggestion or help .. i want to add STRING capability in this following Queue program. currently it just eccepts the chars . so if somone can help me out in getting the String output. thanks [CODE]#include "stdafx.h" /***** Structure template *****/ struct list{ …

Member Avatar for Ancient Dragon
0
129
Member Avatar for guest7

Hi, I am trying to use the "partition" from STL algorithms. I get the following error: [CODE]error: no matching function for call to ‘partition(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, <unresolved overloaded function type>)’ /usr/include/c++/4.2.1/bits/stl_algo.h:2098: note: candidates are: _ForwardIterator std::partition(_ForwardIterator, _ForwardIterator, _Predicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int, …

Member Avatar for Banfa
0
397
Member Avatar for Fenlevi

Hi people,in the assignment I was give the main function and was told to write a class, and the output is supposed to be like this: BLANK(0,0) Destination (6.2,16,7) BLANK (45,0) Destination (6.2,33.4) The x coordinate of source is:45 The y coordinate of source is :33.4 The label of point …

Member Avatar for jonsca
0
133
Member Avatar for rtllz

Im using xcode to write my program. Every time I build and run the program it will do everything fine, until the end. It keeps giving me an answer of 0 no matter what i put. Need help to figure out what im doing wrong thanks in advance. [CODE]//price_converter #include …

Member Avatar for rtllz
0
144
Member Avatar for Buttacup

I am a little unclear on what is happening here and if it's even necessary. [code] ICOMInterface** pICOMInterface = new ICOMInterface*[reserve]; for(SIZE_T i = 0; i < required; i++) pICOMInterface[i] = new ImplementingClass; for(SIZE_T i = (reserve-1); i >= required; i--) delete pICOMInterface[i]; [/code] I'm trying to get a set …

Member Avatar for Buttacup
0
133
Member Avatar for code zombie

[CODE]#include <iostream> template<class T1, class T2> class TwoThings { T1 thing1; T2 thing2; public: TwoThings(T1 t1, T2 t2) : thing1(t1), thing2(t2) {} template<class T3, class T4> friend std::ostream& operator<<(std::ostream& os, const TwoThings<T3, T4)&); }; template<class T1, class T2> std::ostream&::operator<<(std::ostream& os, const TwoThings<T1, T2>& tt) { std::cout<<tt.thing1<<' '<<tt.thing2; return os; } …

Member Avatar for mitrmkar
0
127
Member Avatar for pinsickle

Which would be considering a better coding style, this is for a merge sort in case you are wondering what I am doing with this line of code [CODE] int j = 0; // used to track for the temp array earlier in my code // reset it to be …

Member Avatar for Ancient Dragon
0
99
Member Avatar for confuse89

I am doing an C++ assignment on customizable scientific calculator. I wish to ask how to write a program that can automatically identify the variables when i load a formula? for example, when i input a formula: x + y the program will display: x? y?

Member Avatar for Buttacup
0
76
Member Avatar for YeMiller

Hi, I've had a quick look through this forum and can't really see anything to help. I've got a basic but fair knowldge of C++ but I'm unfortunately not very good at putting my knowledge into raw code :D. I'm currently doing an assignment to read data from one of …

Member Avatar for WaltP
0
142
Member Avatar for correaj

Good Day Folks! I'm having a difficult time getting this operator overloading function to work. I have try various syntax to get it to work. When I run the following code I get this compile error. [COLOR="Red"]g++ -Wall hmw6.cpp -o driver set.h: In instantiation of `correaj::set<int>': hmw6.cpp:9: instantiated from here …

Member Avatar for correaj
0
3K
Member Avatar for kira_

hello there. there's an error in my program that I cannot identify. Every time i call a function for my declared variable of type Stack, there will suddenly be a run time error. I really don't get what's wrong with my code because my implementation seems to be right but …

Member Avatar for mitrmkar
0
103

The End.