51,593 Topics

Member Avatar for
Member Avatar for esesili

Hello again, I am trying to generate an array which has random integers. Then I have to sort it and perform binary search. Below is my code so far. It gives error message (runtime check failure 2 stack around the variable num_arry was corrupted). When I define num_arry[10] instead of …

Member Avatar for tux4life
0
105
Member Avatar for barige rajesh

[code] int main() { int *ptr=new int (100); cout<<"p's add is "<<ptr<<endl; cout<<"value in p is"<<*ptr<<endl; delete ptr; // deallocation of ptr; cout<<"p's add is "<<ptr<<endl; cout<<"value in p is"<<*ptr<<endl; return 0; } [/code] Even the delete operator is executed, the last two output statements are working same the first …

Member Avatar for barige rajesh
0
229
Member Avatar for VernonDozier

I posted a program earlier today in response to another thread and noticed that I had forgotten to clean up/free the memory I used. Here's the program. [code=cplusplus] #include <iostream> using namespace std; int main() { int LIST_SIZE, NUM_CHARS_PER_ELEMENT; cout << "Enter number of elements in list: "; cin >> …

Member Avatar for wildgoose
0
188
Member Avatar for GooeyG

I am horrible at making UML diagrams.The only one that i can make are the class diagram. The reason why i struggle making UML diagrams is that i don't have the algorithming concept down. Can anyone give me any suggestions that could ease this process for me? Thanks...

0
104
Member Avatar for lancevo3

I am having trouble with my copy constructor for a Deque program I am writing. It just does not seem to be doing any copying anyone notice a quick fix on this? [code=cplusplus] Deque::Deque(const Deque& oldDeque) { dArray = new int[oldDeque.dMaxSize]; int sub = oldDeque.dMaxSize; for (int i = 0; …

Member Avatar for lancevo3
0
1K
Member Avatar for wingers1290

Hi, I am creating a program for my business that allows us to write quotes quickly, I am fairly new to C# and am stuck on a particular matter. i cannot relate to my Dynamically created textbox no matter what i name it, i am using the following code to …

Member Avatar for Antenka
0
311
Member Avatar for BattlingMaxo

I have been away from programming but now i have more time. I want to make a fish that moves with procedural animation (just programming no keyframing )The fish will have at least 3 bones so i can move it in a sine wave, once i get that i will …

Member Avatar for BattlingMaxo
0
127
Member Avatar for headedtomexico

I've done a little looking around and found a few different ways to do this, and I was looking less for technical help, and more for opinions before I dove into the code. The software I'm sending out doesnt get installed, its just unzipped and placed in random folders on …

Member Avatar for Ancient Dragon
0
155
Member Avatar for tazboy

list is supposed to be an array of pointers, so hopefully I declared that correctly. This function is supposed to read lines of text and each line of text should have a pointer pointing to it so that I can sort them. What I don't understand is when I read …

Member Avatar for VernonDozier
0
213
Member Avatar for dumrat

Hi, Can someone tell me how to suppress all the warnings g++ produces? Not specific warnings : I know how to do that. I want to not see any warnings at all when I build. Thanks.

Member Avatar for Tom Gunn
0
431
Member Avatar for laconstantine

My first school project after first year of c++ studying in 10 grade for summer to code virtual stack emulation in C++.. Well i've done it perfectly finished just today !! It supposed to be for all summer I finished in fast in 1 day lol not nerd :) Just …

0
93
Member Avatar for tazboy

Here is what I have: [CODE]} else if ( argc > 1 ){ for ( int arg = 1; arg < argc; ++arg ){ infile.open( argv[arg] ); if ( infile ){ list = read_file( &infile, &lines ); } } } [/CODE] argv[1] = text.txt gets opened, but argv[2] = text2.txt …

Member Avatar for tazboy
0
145
Member Avatar for naeem1973

i have a text file abc.text having 32 characters only. 2b7e151628aed2a6abf7158809cf4f3c i want to load this file in char *key[16] as below char *key[16] ={"2b", "7e", "15", "16", "28", "ae", "d2", "a6", "ab", "f7", "15", "88", "09", "cf", "4f", "3c"}; i use the following code char ch; int i=0; ifstream …

Member Avatar for kvprajapati
0
211
Member Avatar for jjplaw

Hi, i want to implement a windows service that functions as a simple license security feature for a software X. The service is meant to run independently from software X. [B]My current idea:[/B] [LIST]The service is like a timebomb for a software Z installed on the machine...[/LIST] [LIST]Whenever the user …

Member Avatar for tux4life
1
177
Member Avatar for Yaserk88

I am reading a file that has a column of words, but each time the column is read, the first letters are the only things that are outputed. Does anyone have any simple solutions to this? I don't want to have each letter be a separate variable. [ICODE]#include <iostream> #include …

Member Avatar for Yaserk88
0
118
Member Avatar for san_sarangkar
Member Avatar for xnoiz

Since i am a Ph.D student in material science, i have no previous experience in programming, and for 1 week now i am trying to write a simple program...where i can use some help from you. I have written a program that can read every line in a txt file …

Member Avatar for tux4life
0
173
Member Avatar for pltndragon

The question is to write a function that dynamically allocates an array of integers. the function shoud accept an integer argument indicating the number of elements to allocate The function shoud return a pointer to the array Here is what i have so far, and it kinda works but at …

Member Avatar for tux4life
0
2K
Member Avatar for umair125
Member Avatar for gretty

Hello How do I create an array when the size of the array is unknown? IE; the size of the array will depend on the contents of a file I am reading, so sometimes the array will end up being 10 sometimes 100. The way I have tried, is to …

Member Avatar for iamthwee
0
118
Member Avatar for Se7Olutionyg

[CODE]#include <iostream> #include <iomanip> using namespace std; int main() { string name; char indicator = 'c' ; // Input indicator char answer1,answer2,answer3,answer4,answer5; int count1,count2,count3,count4,count5; cout << " Welcome to Risk master, answer those 5 questions to calculate how risky your partner is"; cout << " Rule : press Y for …

Member Avatar for WaltP
0
163
Member Avatar for zsady

Hi there, Im new to this forum so please bear with me. I need help in knowing how to copy an entire row in Excel using C++. Im not allowed to convert it to CSV format either. Ive researched and found a way how to open read Excel files using …

Member Avatar for Ancient Dragon
0
96
Member Avatar for crh0872

Hey guys! I was writing a program that had an infinite loop, [ICODE]while (1)[/ICODE], and within that loop was an if statement checking to see if a certain amount of time had passed. If it did, it would print out something, if it didn't, it would print out a [B]'.'[/B]. …

Member Avatar for crh0872
0
131
Member Avatar for jportifer

Hi. I'm programming in Borland C++ Builder v. 6.0. I'd like to know where could i get a Directory Dialog component. Thanks in advance.

Member Avatar for jportifer
0
75
Member Avatar for C++ Obliviator

I'm trying to create a 3D vector with dynamic vectors of char. I mean like this: 3dVect is only [U]one[/U] 3D vector 3dVect[0][0][12] 3dVect[0][1][5] 3dVect[1][0][6] 3dVect[1][1][9] 3dVect[1][2][8] ... this mean: 3dVect[0][][] consists of 2 2D vectors, and the 2D vectors have different sizes. I have read the thred [URL="http://www.daniweb.com/forums/thread136351.html"]http://www.daniweb.com/forums/thread136351.html[/URL] and …

Member Avatar for C++ Obliviator
0
110
Member Avatar for SammiSmi

Hi I'm new to C# and ASP.NET. Do you know any advanced website tutorials? or downloadable ones? Thanks (^^,)

Member Avatar for serkan sendur
0
101
Member Avatar for huzeifa

I am working on a ftp client program and i wana know how to save password without creating a text file. If its possible to achieve this using xml or any other method please show me how. If u have a project or sourcecode on this please upload it in …

Member Avatar for tux4life
0
85
Member Avatar for yara naser

please can you help me to translate this code from c to c++ /*************************************************************** Program describtion : ===================== This program is for creating a Lexical Analyzer in c Created by : ============= CoMPuTeRQ8 kuwait university Major : COMPuTeR-SCIeNCe *****************************************************************/ /**************************************************************** Necessary Header files used in program. *****************************************************************/ [code=c] #include<stdio.h> #include<string.h> …

Member Avatar for necrolin
0
176
Member Avatar for Shaitan00

I am trying to customize my sorting of a LIST using a compare_function, but for some odd reason it keeps giving me the following error: error C2064: term does not evaluate to a function taking 2 arguments Specifically, I have list created within class B which needs to be sorted, …

Member Avatar for Salem
0
358
Member Avatar for macla
Member Avatar for tux4life
0
145
Member Avatar for smithss

[code=c++]int** a = new int*[col]; // works int** b = new int[][col]; //error cannot convert from 'int (*)[1]' to 'int ** int* c[] = new int[][col]; /error cannot convert from 'int (*)[1]' to 'int *[]' [/code] The first one works, but i get these errors when i use the other …

Member Avatar for VernonDozier
1
139
Member Avatar for richm.analytica

I wish to collaborate with someone who can write a program that would sort a large array [15x15] based on criteria other than alphabetical or numerical order. I am very new to C++.

Member Avatar for oop'stechie
0
116
Member Avatar for nanchuangyeyu

Hi, I have implemented my first C++ class as following thanks to the generous help of Ancient Dragon: [CODE] typedef unsigned long ULONG; class CMatrix { public: CMatrix(const CMatrix& m); CMatrix(size_t row, size_t col); ULONG sum(); size_t s_row(); size_t s_col(); CMatrix& operator *= (const CMatrix& m); private: size_t _s_row; size_t …

Member Avatar for Tom Gunn
0
108
Member Avatar for dchunt

Now i have an array, P[8]={0,1,1,2,0,3,1,0} And i want to add 4 separate values to each element in the array,so if i was to lookup P[2] i can access its 4 values. I tried doing it by giving those standard values an array of itself and making each value get …

Member Avatar for Tom Gunn
0
153
Member Avatar for pepcoder

Step: 1I have a class Mytest [code] class MyTest { public string Name { get; set; } } [/code] Step2: Created a class Demo to use the member variables of the class myTest [code] class Demo { public void GetNames<T>(IList<myTest> info) { foreach (myTest test in info) { Console.WriteLine(test.Name.ToString()); } …

Member Avatar for sknake
0
134
Member Avatar for Himani_29

Hi, i completed my coding which was related to searching files with .cap extension and then making out folders with a number contained in the file and then putting the files in their respective folders. now when i checked it ,it worked fine and created folders and sorted about 1.5GB …

Member Avatar for Himani_29
0
334
Member Avatar for shtikk

can anyone help me create a typing game of falling letters(randomly), and as the player presses the key of the falling letter, the letter pressed will vanish and the player will gain points...thanks...help me,please...

Member Avatar for pspwxp fan
0
274
Member Avatar for colmcy1

Hey all, I am having some trouble trying to open a dialog window. Firstly I am using MFC in MSVC 6. I have a main dialog window and I am trying to open a second dialog window by clicking on a button("second") in the main dialog window. When I am …

Member Avatar for jencas
0
2K
Member Avatar for sureronald

I am using gcc on Suse Linux Enterprise Server 10 to compile my C++ source files. The problem I have is that when I invoke the command [INDENT][B]g++ source_file.cpp[/B][/INDENT] the file source_file.cpp is compiled as a C source file. I realized the problem when I was trying to set up …

Member Avatar for sureronald
0
116
Member Avatar for alfaximena

My application in C + + uses winsock2.h It use the send method to send the frames to the server developend on java. My application send a string so: #define MAXLONGITUD 10000 char bufEnviados[MAXLONGITUD + 1]; bufEnviados[0] = (0xff & (longitud >> 8)); bufEnviados[1] = (0xff & longitud); send(sock, bufEnviados,strlen(bufEnviados), …

Member Avatar for ithelp
0
156
Member Avatar for sdmahapatra

Hi all C++ expert, I'm new in this field. I've written a program but I need to write it using class. I'm not able to understand where I'll define [quote]a = new double[numElement];[/quote] etc.... and [quote]delete [] a;[/quote] etc... I'm confused where and why I'll define 'new' & 'delete' using …

Member Avatar for csurfer
0
231
Member Avatar for osan

Hi, I am now working with MFC and I have a main window, but I want to create a button, and when clicked, a new window to apppear, and also I want to draw in the new window. I created the button, and when cilcked is drawing a rectangle..it was …

Member Avatar for jencas
0
91
Member Avatar for eXsolved

Hey Guys/Girls I'm creating a C++ application. So far I have created 2 projects, under one solution. The first is a native win32 project and the other is a DLL. Now my problem. How do I include this DLL I create, in my win32 application? So far I have tried: …

Member Avatar for Utte
0
174
Member Avatar for Nowayz

Was recently asked to convert some code, but I have a minimalistic ammount of knowledge of delphi and I wasn't able to convert this code. If you could help me out it would be great. [code=c++] void TypeStr(char *lpszString) { char cChar; while((cChar=*lpszString++)) // loops through chars { short vk=VkKeyScan(cChar); …

Member Avatar for Duoas
0
221
Member Avatar for hwaterboys

Can someone please tell me how I would wrap my array. Lets say that it is of size 10. What I want it to do is count the number of letters in the name then mod it into the array (This is working properly). If a name has the same …

Member Avatar for hwaterboys
0
123
Member Avatar for shizu

Hi all, I'm using microsoft visual C++ 6.0 with SP4 and SP5.. I had a program which content a CScrollView.. Now I would like to add in a image into CScrollView.. but my image is buffer..not from resource.. I can save my image, bitmap form, into local drive.. but I …

Member Avatar for shizu
0
142
Member Avatar for oopg

hihi, when I open a file using ofstream or fopen, the memory cannot be released after I call [B]close() [/B]function. how can I release the memory? P.S. the memory can be released after remove the files. the program code: [CODE] int main (int argc, char **argv){ ofstream file1; while (true){ …

Member Avatar for Ancient Dragon
0
279
Member Avatar for nova2177

wow, haven't been here for sometimes due to the business aspect of my course. would like some help in understanding what is set, get, change and return in c++. have an assignment with topics the class haven't covered as yet, but I'd love to understand it before we reach those …

Member Avatar for Ancient Dragon
0
158
Member Avatar for bnekolny

Hello, So I've got a code where I'm wanting to make sure that there is nothing in this class variable "finalgrid". To do this I've got an if statement: [code]if(canvas->finalgrid) OR if(finalgrid)[/code] Sorry for the confusion with the two statements, but I'm working on modifying one project to fit in …

Member Avatar for bnekolny
0
107
Member Avatar for nanchuangyeyu

Hi, I am a C++ newbie and had never written even a very simple C++ class before. Now I intend to do such a job. My objective is quite simple, a matrix class with the following features is just OK: [COLOR="Red"]1. The object of such a class can be initialized …

Member Avatar for Ancient Dragon
0
388

The End.