49,757 Topics

Member Avatar for
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
296
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
11K
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
154
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
652
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
301
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
533
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
695
Member Avatar for Sunil_12

I am getting following error, while passing a C++ string variable to SQL insert command: error C2679: binary '+' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) Below is the code: int main() { int empid = 12; int phone …

Member Avatar for Sunil_12
0
1K
Member Avatar for lian_1

Good morning. I would like to ask for help on our FINALS PROJECT. Our professors told us that he have given us everything we need but we don't have any idea. The requirements are : A.Adding of Records. -User should be allowed to enter a maximum of 15 record. -However, …

Member Avatar for deceptikon
-1
105
Member Avatar for SK1994

I have made a Biginteger class that performs multiplication operation according to Karatsuba's algorithm. But it seems that the code is not working perfectly.In the class I have made a function named karatsuba(BigInteger a1, BigInteger b1)that performs the Multilplication operation. There might be problems in this function as I have …

Member Avatar for tinstaafl
0
342
Member Avatar for Vasthor

[Click Here](http://s27.postimg.org/syqganxir/New_Bitmap_Image.png) "Having a container of pointers raises the question of how to destroy it. If you simply "do the right thing" and define a FilmList destructor that visits each of its pointers and deletes it, you must then worry about client code that contains a function with a FilmList …

Member Avatar for mike_2000_17
0
348
Member Avatar for cannon_1

I am using Xcode to do c++ programming and I have a c++ code, with different input arguments. I want to achieve that in Xcode, I could run multiple simultaneous running of my c++ code. However, the current problem is that once one code finishes, its terminal window automatically closed …

0
84
Member Avatar for thilinam

The End.