49,761 Topics

Member Avatar for
Member Avatar for tapiwa.matombo

in response to an inclass exercise where the following question was possed: write a program using structures, which will capture a list of 10 movies, the data members should be title and year. the problem is the program is not capturing all the details and is printing unintelligible information. what …

Member Avatar for Banfa
0
151
Member Avatar for ceelos1974

Hi I got a problem with converting from LPARAM to std::string. What I do is getting the selected object from a Listbox, the example I found on how to do this is to convert the object to LPARAM. Now I want to convert this LPARAM to std::string and I've tried …

Member Avatar for ceelos1974
0
2K
Member Avatar for wad11656

So basically I have: // FUNCTION double function(yadee_yada) if (input < 0) { return 0; } else { return something; //code } // END FUNCTION //MAIN int main { int menu; int input; do { cout << "Press 1, 2 or 3 (3=quit program)."; cin >> menu; switch (menu) { …

Member Avatar for Banfa
0
164
Member Avatar for hui

I am creating a program that stores information of hospital patients in a sequential text file.. I want to the program to be able to search for a patient using the patient name already in the text file.. The program is giving me no errors whatsoever so please look into …

Member Avatar for JessiE_03
0
177
Member Avatar for Genessis_1

I am currently trying to test a function with an infinite loop and im having a problem how to break. Is there anyway I can test this? Thanks in advance. void classA::process() { unsigned int return_val; proxy_class& proxy = proxy.instance(); while(1) { return_val = proxy.run(); if(0 == return_val) { //some …

Member Avatar for Dani
0
2K
Member Avatar for musab.hussain.7

All the images those i added in resources of qt project , now i have lost those .. but those are available in "qrc_qresources.cpp" file in any other form (i think 'hexa' ) .. i want to extract images to original form .png .jpg etc .. plx help

Member Avatar for triumphost
0
33
Member Avatar for Riya_2

**It is my humble request if I can get minior help with function definition at the end where its says--- int countvowels (string test) { ** #include <iostream> using namespace std; //function prototype bool is_vowel (char c); //is_vowel(c) returns true if character c is a vowel and false otherwise void …

Member Avatar for Schol-R-LEA
0
192
Member Avatar for Neha_11

ERROR: No such file: Permission denied collect2: ld returned 1 exit status Process terminated with status 1 (0 minute(s), 0 second(s)) 0 error(s), 0 warning(s) (0 minute(s), 0 second(s)) Earlier, I tried dev C++ also, it was also raising the same problem. I don't know how to deal with this …

Member Avatar for Moschops
0
213
Member Avatar for Margi_1

I am trying out friend functions in different files to see how it work. However, I am having problems compiling it with error after error. Well now I'm done to one error again, please have a look at my code: /* ---------- classOne.h ---------- */ #ifndef CLASSONE_H_ #define CLASSONE_H_ #include …

Member Avatar for tinstaafl
0
298
Member Avatar for lewashby

In the program below I'm a little confused with these two lines -> `fbin.seekp(n * recsize);` & `fbin.write(reinterpret_cast<char*>(&age), sizeof(int));` In the first one, why would we start writing to the file at position n * recsize instead of position 0? I would think that we would start writing at 0 …

Member Avatar for deceptikon
0
129
Member Avatar for Tycellent

Is anyone familiar with "removing" an image from screen with SDL? It's just simply a toggle on/off function that i'm looking for. I don't really want to free/release the image, since i intend on using it again throughout the program. switch (e.key.keysym.sym) { case SDLK_a: drawSDL_RenderFillRect(...); break; case SDLK_b: **remove …

0
115
Member Avatar for FireNet

File I/O With C++ Fstream **Intro** File handling is as simple as writing in a book, much easier to modify and find. It's so simple people get confused with it :-). Welcome to the world of file handling. We will use the c++ fstream classes to do our file handling. …

Member Avatar for Swalih
5
12K
Member Avatar for jBat

I'm trying to understand how the function encrypt works (linux), but event with this simple example is not working. Any ideas?. Thank you. #define _XOPEN_SOURCE #include <unistd.h> #include <stdlib.h> #include <iostream> #include <string> int main() { const char key[64] = "12" ; /* bit pattern for key */ char txt[64] …

Member Avatar for tinstaafl
0
155
Member Avatar for aluhnev

//Hi all ,can you explain why does this functon has two returns? //How to read them? Is it like if/else? int _tmain(int argc, _TCHAR* argv[]) { int x, n; int res; int power(int, int); cout << "Enter a number:"; cin >> x; cout << "Enter a power:"; cin >> n; …

Member Avatar for cgeier
0
174
Member Avatar for DS9596

Can you tell me what's wrong with it because it's not running on visual studio and I need it right now??? #include <iostream> #include<vector> #include<algorithm> #include<limits> #include<fstream> #include<string> using namespace std; class PayRoll { private: vector<int> salaries; public: PayRoll(); bool searchSalary(int salary); void generateStats(); void printSalaries(); }; PayRoll::PayRoll() { ifstream …

Member Avatar for cgeier
0
180
Member Avatar for moaz.amin.37

i write a code that coun t the number of upper case letter in a string there is a problem my code count space as capital letter code is below #include<iostream> #include<conio.h> #include<cstring> #include<string.h> using namespace std; class Letters{ private: char str[20]; int num; public: Letters(){ str[0]='\0'; num=0; } void …

Member Avatar for Sarkurd
0
654
Member Avatar for Syafiq_1

I want to make a program that can display the name and marks that user put and then the name will be sorted alphabetically. According to these two example i still cant get it. I have go through many examples on the internet but i still dont know how. Someone …

Member Avatar for Lerner
0
2K
Member Avatar for Tycellent

Hey guys, Was wondering if someone could assist me in elaborating the c_str() function... I understand that it returns a pointer to an array that contains a null-terminated sequence of character but could someone further elaborate upon this, perhaps with a simple example. Cheers,

Member Avatar for Lerner
0
180
Member Avatar for shahab saeed

hi! i have written a code of linked list using character array to add and display data, it can add data but not display. can anyone help?? thanks. #include<iostream> using namespace std; class node private: char data[30]; node* next; public: char showdata() { return data[30]; } void setdata(char c[40]) { …

Member Avatar for tinstaafl
0
144
Member Avatar for catastrophe2

hi so this code here as i test it on paper provides paranthesis on every leaf node, disregarding priority (operator precedence) how can i make it add those paranthesis based on precedence of operators? void printInfix(Node n) { if (n == null) { if (n.isLeaf())//if n is a leaf, therefore …

Member Avatar for catastrophe2
0
239
Member Avatar for Joshua_9

Can you make me a program that does this: Amount of numbers:5 // any number 123 // arrays 343 424 34234 344 // random numbers output mean: //calculates the mean standard deviation: //calculates the standard deviation

Member Avatar for David W
0
303
Member Avatar for Alexandra Nichole

Using an array write a program that asks for 10 numbers of type int stores it in an array and traversing each item counting the number of items that are greater than 5.

Member Avatar for Schol-R-LEA
0
91
Member Avatar for catastrophe2

hello I have an inquiry about reading from a file. so if i have a file and if it opens (meaning it is there) how do i check if there is data? ifstream file("example.txt"); if (file.good()) { //file.open("example.txt"); // is this necessary again???????? i read that the ".good" provide checking …

Member Avatar for catastrophe2
0
2K
Member Avatar for DS9596

I did some don't know how to read into the vector, need help on this assignment: Rich Software Inc. has hired you for an internship position to create new payroll software for their employees. Your goal is to create a program that reads the newdata.txt file with their salaries. After …

0
152
Member Avatar for Sarkurd

Hi I have tried to implement Linked-List data structure and i was folowing a guide but i have an `error` in line 12 in `contactlist.h` I have included `contact.h` properly but still not working :-/ contact.h #ifndef CONTACT_H #define CONTACT_H #include <iostream> #include <string> #include "contactlist.h" class Contact { private: …

0
99
Member Avatar for cambalinho

i continue with problems for use a callback function in a class member :( class Timer { private: typedef std::function<void(void)> timerprocedure; timerprocedure tmrprocedure;//can't be static int MilliSecondsTimer; bool blnDestroyed; UINT TimerId; HANDLE Timer1; static void CALLBACK MyTimerProc( HWND hwnd, UINT message, UINT idTimer, DWORD dwTime) { tmrprocedure();//call the lambda timer …

Member Avatar for Banfa
0
488
Member Avatar for Joshua_9

how would i make a program that outputs this: amount of vairiables: 3 3123 1412 2412 mean: 1414 standard viariance: 4344

Member Avatar for David W
0
535
Member Avatar for MandrewP

Is double pre-incrementing undefined behavior? Like ++++x or even ++++++++x. I think it must be since it all occurs between sequence points. But what could possibly go wrong? Or do you just not ask that question and automatically stay away from any undefined operations? Is double incrementing ever routinely used? …

Member Avatar for shahid_650
0
201
Member Avatar for bernardo.mclobo

Hi. I'm learning by myself data structures with c++ but i got stuck Here's my code: #include<iostream> #include<cstring> #include<string> #include<sstream> using namespace std; template<class T> // node class class nodeType { public: nodeType(); nodeType(T); ~nodeType(); nodeType *next; nodeType *previous; T data; //string getkey(); string Id; //void borra_todo(); void imprime(); // …

Member Avatar for tinstaafl
0
243
Member Avatar for mary ann_1
Member Avatar for Schol-R-LEA
0
699

The End.