49,761 Topics
| |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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); … | |
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 = … | |
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 … | |
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> … | |
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 … | |
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 | |
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> … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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; } … | |
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 … | |
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 … | |
Using "Nested For" Loop, Write a program that prints the letter M. Thank you All! | |
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:) | |
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 … | |
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 |
The End.