49,762 Topics

Member Avatar for
Member Avatar for sabareesh

// find new size nNewArraySize = StrNewSizeForCharReplace(pszString, pszFindString, pszReplaceString); // nNewArry size is 1063 // alllocate memory pszTemp= (unsigned char*)malloc(nNewArraySize + 1); // add 1063 character in to pszTEmp // 1063 nLength = strlen(pszTEmp) // length is 1063 free(pszTemp); // Heap memory exception How can remove this exception

Member Avatar for Ancient Dragon
0
131
Member Avatar for Rickay

why doesn't this work? [CODE]int main() { fstream file; char output[100], pasword[100]; int a; const string x("Yes"); const string y("No"); string z; char b; cout << "\nEnter correct password to continue: \n" << endl; cin.getline(output, 15); if(output == "file.txt") { cout << "Change password? Type Yes or No. \n" << …

Member Avatar for Ancient Dragon
0
142
Member Avatar for kunal kislay

[code] main() { double **vals = NULL; function(vals); } [/code] prototype : [code] //some other dll void function(const double**); [/code] it gives me error : cannot convert double ** to const double **. and yes i dont want to put extra burden on the user side(in main function) to const …

Member Avatar for Agni
0
109
Member Avatar for bleedi

Hey again! I ran into a new problem in my university course exercises. Basically, I'm trying to read things from a .txt file. Every line is supposed to get converted into an object called "Client", and lines are formatted like this: <account:int> <firstName:string> <lastName:string> <balance:double> I have written my own …

Member Avatar for mrnutty
0
254
Member Avatar for ellainian

Please give me a sample code in MFC VC++ of CMovingButton move to left and move to right.

Member Avatar for Ancient Dragon
0
29
Member Avatar for jagan605

I have recently learned in school about the dreaded diamond.And I wrote a program using virtual inheritance to overcome the problems.I use g++ and I have the following errors with this program, [CODE]//doing to create an illustration for dreaded diamond #include<iostream> using namespace std; class vehicle { public: virtual void …

Member Avatar for Fbody
0
556
Member Avatar for jagan605

Iam using ubuntu 10.04 LTS.I have a problem in including graphics.h in the g++ compiler I am using.I have nearly tried all the possible solutions given while i googled about it. Please help me .I am a beginner to programming.

Member Avatar for jagan605
0
315
Member Avatar for ThrasherK

I need to write a function that sorts a two-dimensional array using this header: [CODE]void sort(int m[][2], int numberOfRows)[/CODE] my code is supposed to primarily sort the rows and secondarily sort the columns. The program is supposed to take ten points entered by the user and sort them. I cannot …

Member Avatar for ThrasherK
0
185
Member Avatar for khaled mohamed

hello , i have an trouble in switching between graphics mode and text mode i have an interface by using graphics mode and when you press in a key of it will transfer to a window by text mode when this operation occur the dimension of the second window is …

Member Avatar for khaled mohamed
0
119
Member Avatar for Takudzwa Tizora

how would one define RANDOM FILES as well as suggest ways of creating and updating them in Visual C++?

Member Avatar for mrnutty
0
103
Member Avatar for everard

I'm creating a logfile interpreter program that consists of two editboxes. The first editbox contains the original logfile code, and the second editbox contains the equivalent code of the first editbox in user-readable format. All I want to do now is, everytime I select or highlight a specific code in …

Member Avatar for Trepach
0
2K
Member Avatar for Duplaix

hey my name is duplaix..am new in c++ so i need help! I have to write the following set of c++ functions ï‚· fromBinaryToDecimal: The function must accept a pointer to a one-dimensional, dynamically allocated, Boolean array together with an integer representing its length as parameters. You may assume that …

Member Avatar for mrnutty
0
147
Member Avatar for ThrustinDuffman

Hello everyone! Im new to programming and Im working on an assignment but I keep running into trouble. My assignment is to make a trivia game and although I have made pretty good progress, I am stuck on one particular part. The part I am stuck at is I am …

Member Avatar for ThrustinDuffman
0
164
Member Avatar for PDB1982

Can someone explain to me, the purpose of the "public" and "private" options of a class?

Member Avatar for Knightly
0
555
Member Avatar for Frederick2

The memset function declared in memory.h is declared this way... void* memset(void* dest, int c, size_t count); and the MSDN example of its use I have shows this for setting the 1st four bytes of a buffer to a '*'... memset(buffer, '*', 4); The 2nd parameter confuses me a bit …

Member Avatar for Frederick2
0
636
Member Avatar for merse

Can you recommend a free C++ compiler and editor under windows which is good for error tracking? I mean, I can step the program line by line, and check the values of variables?

Member Avatar for Ancient Dragon
0
57
Member Avatar for vlad44

hi everbody I was opening all files in a certain folder I've used WIN32_FIND_DATA, FindFirstFile, FindNextFile. it works well but for certain extension that i ask the user to enter i.e it will get only all the files with the extension given by he user and ignore any thing else …

Member Avatar for Ancient Dragon
0
195
Member Avatar for Garrett2011

take two following classes: [CODE=c++] class Test1{ public: Test1()=default; Test1(char in1,char in2):char1(in1),char2(in2){} char char1; char char2; }; class Test2{ public: Test2()=default; Test2(char in1,char in2):char1(in1),char2(in2){} private: char char1; char char2; };[/CODE] I know in c++0x both of these classes are considered as POD types and we can initialize objects of them …

Member Avatar for Garrett2011
0
286
Member Avatar for Garrett2011

take two following classes and their constructors as samples: [CODE=c++] class One{ public: One(int a,int b):adad1(a),adad2(b){} private: int adad1; int adad2; }; class Two{ public: Two(int input[]){ for (int i=0;i<10;i++) araye[i]=input[i]; } private: int araye[10]; };[/CODE] considering objects with static storage duration, I think first constructor can be applied during …

Member Avatar for Garrett2011
0
399
Member Avatar for Garrett2011

How does an optimizing c++ compiler determine when a stack slot of a function(part of stack frame of a function) is no longer needed by that function, so it can reuse its memory? . By stack slot I mean a part of stack frame of a function, not necessarily a …

Member Avatar for Garrett2011
0
419
Member Avatar for badprogrammer

[B]Tic-Tac-Toe Game[/B] Write a program that allows two players to play a game of tic-tac-toe. Use a 2D char array with three rows and three columns as the game board. Each element of the 2D array should be initialized with a space. The program should work as follows. 1. When …

Member Avatar for mrnutty
-1
116
Member Avatar for Jackie91

I was having an error, it says cannot convert string into int..i have no idea how to convert string into int. My teacher asked me to read 5 students names into the array..help me pls.. [CODE] #include<iostream> #include<string> #include <stdlib.h> using namespace std; int search(int data[], int size, int value) …

Member Avatar for Lerner
0
150
Member Avatar for nahmartin

Quick help please I am writing some data to a file but I do not know the information required in the third line until after the file is completed is there a way to point the ofstream back to the beginning of the file so that i can edit it …

Member Avatar for mike_2000_17
0
423
Member Avatar for ssmg

Hi everyone; I have a character array of 13 elements and I already defined the first 5 ones. The rest chars are constant so all I need to do is assign the chars between 6-12 instead of writing them one by one.To make it clearer, say my string is "ILoveYouMary" …

Member Avatar for ssmg
0
120
Member Avatar for siriphonic.ner

*I need help solving this. Stuck half way. Would someone mind giving me an example of their program of this?* The local t-shirt shop sells shirts that retail for $12. Quantity discounts are given as follows: Number of shirts Discount 5-10 10% 11-20 15% 21-30 20% 31 or more 25% …

Member Avatar for siriphonic.ner
0
2K
Member Avatar for emps

Ok, this has got me banging my head against a wall. I have a structure defined in a header file. It get initialized in my "main.cpp" file, then later in a separate file "readconfig.cpp" it gets accessed to store information. I haven't been able to get it to compile except …

Member Avatar for emps
0
1K
Member Avatar for angelinrajeesha

Hi, what are the classes that cannot be instantiated in c++? I know that one of the ans is Abstract base class.what is the other one in c++? could you please help us?

Member Avatar for angelinrajeesha
0
620
Member Avatar for ThrasherK

I am new to programming but when I took my class on Visual Basic it seemed so easy and I learned it so fast. It seemed like a giant puzzle. Now I am taking a introduction course to C++ and I cannot seem to grasp the material at all. When …

Member Avatar for Fbody
0
673
Member Avatar for Garrett2011

Is there a macro that can get a text as input like "abc" and then extract characters in that text and generate a code using them, something like "{'a','b','c'}" ? thanks.

Member Avatar for mike_2000_17
0
206
Member Avatar for Garrett2011

Suppose we have following two classes: [CODE=c++] class Temp{ public: char a; char b; }; class Final{ private: int a; char b; char c; public: Final(Temp in):b(in.a),c(in.b){} //rest of implementation };[/CODE] can we initialize an object of the Final class with following syntax in upcoming c++0x standard: [CODE=c++] Final obj(Temp{'a','b'});[/CODE]

Member Avatar for mike_2000_17
0
252

The End.