49,761 Topics

Member Avatar for
Member Avatar for bhas_purk

hi, how do I create an array of pointers to a struct using malloc? using malloc like this- [CODE=c] abc * a = (* abc)malloc(sizeof(abc)*10); [/CODE] I get an array of struct objects. I can access member elements using the "." operator. eg a[2].xxxx what I want is an array …

Member Avatar for bhas_purk
0
142
Member Avatar for NitaB

Hi all! You've probably all heard of some rendition of the game of life and now it's my turn to try and code it.:-/ Anyway, everything is fine up until my Life function(this is the function where I put all the "rules" of life). My output is now completely blank. …

Member Avatar for NitaB
0
584
Member Avatar for samsons17

hi... i want to know how do i use database to make a simple c++ program for console.. Somebody told me before that i could use the SQLite database for the receipt program that i'm making.. I just want to know about this further and if i could,i also want …

0
64
Member Avatar for toneranger

Hi, The following code I've been working on (as hobbyist) compiles okay, buy at runtime it fails to output the dates that it is supposed to extract from a csv file. I've been staring at this forever and no progress. I am thinking that the problem occurs before the date …

Member Avatar for VernonDozier
0
164
Member Avatar for Web_Sailor

Hi :icon_smile: I have written a C++ program which works very fine. The problem comes in terms of efficiency and speed. I am using a multimap which is required for my type of requirement. [CODE]multimap<string,string>[/CODE] Now the problem is that for files more than 100 MB it takes a lot …

Member Avatar for Web_Sailor
0
66
Member Avatar for xFlow

Hello every one im doing my project for c++ class and was trying to compere 2 elements in the array to see if the length of the string that i've read from the file are the same whenever i read a row i also store the length of it in …

0
68
Member Avatar for Viralguardian

Hello! I have this homework problem, that I thought I had figured out, but once I fixed all the syntax errors and debugged it again it gave me some weird numbers...something I totally didn't expect. Can anyone give me a clue as to where I went wrong? I suspect that …

Member Avatar for Viralguardian
0
201
Member Avatar for tyacag876

I'm having trouble implementing how to get it to read every word from the document and check to see if its in the dictionary using the hash table.. Please help anyone. I'm fairly new to programming. I have to develop a spell checker program. MY program has to use a …

0
105
Member Avatar for hajiakhundov

Hello. Can someone please tell me how can I get the Text from the textBox, and store it into a string for instance. To be more specific, I have a function: [CODE]foo (const char* str, const char *strat);[/CODE] And when I call it, I want it to take the the …

Member Avatar for hajiakhundov
0
91
Member Avatar for react05

Hey guys, how would i convert the code in option ascending and descendingGPA to where it sorts all students in ascending order by lastname and all students in descending order by gpa. thanks! [code] #include <iomanip> #include <iostream> #include <fstream> #include <cstring> using namespace std; struct StudentRecord { char lastName …

Member Avatar for Ancient Dragon
0
106
Member Avatar for iluv2laugh

Hi folks, I am using FindNextFile() and GetFileTime() to find a file in a folder with the latest creation time. The code is as follows... [code=c] WIN32_FIND_DATA ffd; HANDLE hFind = INVALID_HANDLE_VALUE; DWORD dwError=0; LPWSTR filePattern[MAX_PATH]; LARGE_INTEGER filesize; FILETIME ftCreate; FILETIME maxCreationTime; maxCreationTime.dwLowDateTime=0; maxCreationTime.dwHighDateTime=0; hFind = FindFirstFile((LPCWSTR)filePattern, &ffd); if (INVALID_HANDLE_VALUE …

Member Avatar for Ancient Dragon
0
229
Member Avatar for lotrsimp12345

the delete must be by copying the data and then deleting if their are 2 nodes from that one root. CODE IS AT VERY END FOR THAT. CALLED REMOVE. Thanks. main [CODE] #include <iostream> #include "my_bst.h" using namespace std; int main() { my_bst<int,int> ab; ab.insert(4,1); ab.insert(2,2); ab.insert(6,3); ab.insert(1,4); ab.insert(3,5); ab.insert(5,6); …

Member Avatar for lotrsimp12345
0
81
Member Avatar for noey699

I am trying to create a timer that calls a function when the timer ends this is the timer class [code] class CreateTimer{ float OverallLapsed; float EndOfTimer; bool Running; public: CreateTimer::CreateTimer(float); void StartTimer(); void StopTimer(); void Lapsed(float); void SetEndOfTimer(float); bool CheckTimer(); void ResetOverallLapsed(); float GetOverallLapsed(); }; CreateTimer::CreateTimer(float EndTime){ EndOfTimer = …

Member Avatar for noey699
0
94
Member Avatar for hit25

So here is the problem. I have a file that starts with a number, this number says how many entries are in the file (5 means there are 5 names). Each entry takes up two lines in the txt file. First line is the name, the second is a group …

Member Avatar for hit25
0
231
Member Avatar for Bladtman242

Hi, i just don't get why this isn't working. It is supposed to read from the end of a .txt and up, until it hits the first space but it just keeps repeating the last character in the text file ip.txt Any help is much appreciated. [code=c++]#include <iostream> #include <fstream> …

Member Avatar for Bladtman242
0
626
Member Avatar for Darth Vader

I have two processes where the First process sometimes is writing to a file and the second process is reading this file. For the second process I wonder if it is possible to only read the file if the First process does not use the file. How would it be …

Member Avatar for Darth Vader
0
145
Member Avatar for saharh89

I've been lost in this class for weeks and I have no idea how to even do this assignment. [ATTACH]12667[/ATTACH] please help! It's in the attachment

Member Avatar for Narue
0
164
Member Avatar for kavourdoukos

I would like to open from a file and then store the strings stored in the txt filed to an array.The txt file i want to open has 1 string on each line.So each line will be 1 string.What should i change here? [CODE]// reading a text file #include <iostream> …

Member Avatar for kavourdoukos
0
120
Member Avatar for Valaraukar

Hi, I'm trying to update an objects information within my linked list but for some reason after attempting to alter the data no changes appear to have taken place. As far as I am aware I'm not updating a copy of the object because I am finding the relevant object …

Member Avatar for Valaraukar
0
182
Member Avatar for samsons17

Hi.. I'm writing a code for the cash receipt program.... before this,i already make this kind of program.. but the program that i've made before is simply doing this task only : [B] //ask the user to enter the product information... Enter the product id : Enter the product name …

Member Avatar for samsons17
0
96
Member Avatar for hajiakhundov

Hello Everyone. I am creating this Windows Forms Application using Visual Studio. Basically, in order to do what I want to do, I need to use an integer, and that integer needs to be converted into a string in order to change the label text, when pushing the button. However, …

Member Avatar for hajiakhundov
0
2K
Member Avatar for Sky Diploma

Hey Everyone, I have written this Matrix Multiplication program. But The Program seems to crash when during the filling of the first matrix, exactly after the completion of the first row. Here is my implementation [code] #include <iostream> using namespace std; void generate (int ** ,int ,int); void fill (int …

Member Avatar for Sky Diploma
0
153
Member Avatar for sateeshbandi

I Have a C header file which has common structures which are used by various modules. Im developing my code using C++, few of the newly written modules are in C++. We have to use the same structures defined in that C header file. What i am thinking of doing …

Member Avatar for vmanes
0
117
Member Avatar for karthik chinta

Hi, I am trying to develop one requirement wherein I need a C++ map having both Key and Value as Structures. The structures are as follows: [code] typedef struct _keyInfo { int Key1; int Key2; } T_KeyInfo, * T_pKeyInfo; typedef struct _valueInfo { int value1; int value2; int value3; } …

Member Avatar for lyle017
0
10K
Member Avatar for rati

Hi all, I was going throughthe concept of Polymorphism. Can anyone explain me how the vtable and vptr are created in case of virtual base class and what all values it contains. I have idea about the vTable and Vpt in case of polymorphism that the table contains the address …

Member Avatar for Narue
0
257
Member Avatar for fjrivash

Hi *, I have some doubts about passing parameters to a method of a class. I am not sure if it is a problem of my design of the app or a problem of the implementation, I mean C++ knowledge. I have a class called MatrixHandler : The idea is …

Member Avatar for fjrivash
0
127
Member Avatar for norbert90
Member Avatar for Clinton Portis
-5
93
Member Avatar for phpangel

hi guyz, i want to write a program that will find the (sine, cosine and tangent) of adding and subtracting two variables using inheritance and polymorphism concepts. anybody plz help? appreciate the answer:)

Member Avatar for phpangel
0
115
Member Avatar for gehring

Hi All, I am extremely new to C++ and would greatly appreciate any advice regarding the following question: I am trying to create a 2D array of CStrings, however it needs to be declared dynamically for my application. I have read up on numerous forums but I just cant seem …

Member Avatar for Clinton Portis
0
826
Member Avatar for 080346

hello everyone m making game in C++ and i want to know that how i can include music like mp3 or any other format music in my game?? plz help me i shal be very thank ful to u

0
63

The End.