49,761 Topics

Member Avatar for
Member Avatar for skyyadav

I have to find the permutation of vector of integers. I need to implement and interleave function vector<vector<int> > interleave(int x , const vector<int> & v); Using interleave we can implement a permute function. vector<vector<int> > permute(size_t n); that returns a vector containing of the first n positive nos. I …

Member Avatar for skyyadav
0
147
Member Avatar for khelkely

This is just an exercise. And i need to complete this. This is the question : Write a program in C++ that calculates the amount to be paid to an employee based on the hours worked and rate per hour. A user will enter hours worked and rate per hour …

Member Avatar for khelkely
0
239
Member Avatar for Andy90

Hi, I m trying to convert c code to c++. I m stuck at some part! Please help. What will be c++ equivalent of this snippet? void Scanned(FILE * ifp,int i) void Read(FILE * ofp) int Checker(char s[],char u[]) void Stored(FILE *) void Printed(FILE *ifp,FILE *ofp) These are file pointers …

Member Avatar for Ancient Dragon
0
670
Member Avatar for new_developer

Hi there, Is there a way to change strings array size on run time. I mean array size initial value is 1, when i run the program, how much user add values array size increases. I have tried following but its not working, please i need a solution in array …

Member Avatar for new_developer
0
317
Member Avatar for ravi_forum

Sir, I wanted to know the implementation code for krushkal algorithm in C++. Anyone can help me to give the code. ThnQ

Member Avatar for naamurad
2
2K
Member Avatar for dirtydit27

Hello, I'm working on a homework problem for class. I have a text tab delimited file and each row has a orginal base, target base, and a number that is represented in the orginal base. The program should read this file and be able to convert the number from the …

Member Avatar for tinstaafl
0
250
Member Avatar for Labdabeta

This is more of a tale of "I think I broke it". Basically as an assignment for CS I have to write an assembler for a subset of the MIPS assembly language. Currently it is not working, getting a sigseg, so I decided to debug the code and step through …

Member Avatar for rubberman
0
305
Member Avatar for flony

Well, I do not find solution, if any help me would be great, here the code and where the error log is visual c + + 2012 // ver1.1.cpp: define el punto de entrada de la aplicaciĆ³n de consola. // #include "stdafx.h" /* examples/standalone_example_docs1.cpp */ /* Standard C++ includes */ …

Member Avatar for Ancient Dragon
0
181
Member Avatar for VUEKID

I have a set of data imputed into a set of arrays as the following: for (int i=0;getline(file,(cities[i]),',');i++) { getline(file, countries[i], ','); getline(file, latitudes[i], ',') ; getline(file, longitudes[i]); } How do I sort the array line of latitudes and longitudes without changing countries and city it is associated with?

Member Avatar for linux
0
180
Member Avatar for skyyadav
Member Avatar for Williams2222

I need to implement an interpolation search on a linked list, I have some code but I'm getting errors whenever I search anything that isn't the first element. Even if the element I'm searching for is in the list, if it isn't the first one it returns a -1. int …

Member Avatar for Ancient Dragon
0
823
Member Avatar for mating.basalo

[create a data file] [Appened Record] [Edit a Record] [Display a Single Record] [Browse all record] [Exit] program discription mini grading system w\ccompute your final grade. create a data file named studrec.txt accepts the ff. feilds info: ID no Last name First name mmiddle name Quizes and grades Q1 Q2 …

Member Avatar for nikita sen
0
161
Member Avatar for cambalinho

i want build 1 const with std::endl but by some reason isn't accepted:( #define NewLine std::endl i understand the '#define' isn't adviced to be used, but in these case i belive that i can't use the 'const':( what isn't right with that line? error message: "C:\Users\Joaquim\Documents\CodeBlocks\My Class\console.h|170|note: void Console::write(A, B …

Member Avatar for cambalinho
0
233
Member Avatar for jobtardisportal

Friends please help me to made clear ideas about these topics which is better for todays trend c++ or SAP...

Member Avatar for Assembly Guy
-1
146
Member Avatar for cambalinho

i have 1 class: class class1 { void Created(); calss1() { Created(); } } class1; void class1::Created() { cout << "hello"; } imagine that i don't write: void class1::Created() { cout << "hello"; } i get an error. i try these too: class class1 { void Created() { //do nothing …

Member Avatar for cambalinho
0
194
Member Avatar for mixelplik

Please, I know this is a simple question. I'm copying this code out of my text book, almost ver-mother#&$(ing-batm And it mother#&$(ing refueses, REFUSES to open the mother#&$(ing file and write to the mother#&$(ing array. WTF - Sorry for the language, but this is so stupid and silly and I …

Member Avatar for mixelplik
0
189
Member Avatar for Jugottabe

Hey guys, slightly less noob programmer here for a some more help, This week in class we were assigned to create a phonebook with a couple functions to manipulate it, but it seems I am having a couple problems. It seems to me that I have most of the program …

Member Avatar for DeanMSands3
0
225
Member Avatar for Oliver_1

So I'm using GCC. I downloaded MinGW base tools and g++ compiler from the installer, and wrote a basic "hello world" program. The source code is as followed: #include <iostream> int main() { std::cout << "Solidum petit in profundis!\n"; return 0; } I saved this as Motto.cpp. I went into …

Member Avatar for Ancient Dragon
0
186
Member Avatar for nathan.pavlovsky

Hello Programmers! How can I throw an exception if an unsigned int variable overcomes a limit (that is set by myself). I want the exception to terminate all processes. Thanks!

Member Avatar for phorce
0
122
Member Avatar for laklaker

string str; int k=0, count = 0,namelength, size,j=0; char name[80]; char extract[80]; char reversing[80]; cout << "Enter word or enter 'Q' to quit." << endl; cout << ">>"; cin.get(name,80); size =strlen(name); int q=0; for(int i=0;i<=size;i++){ if(isalnum(name[i])){ name[q]=name[i]; q++; }else{ name[i]= '\0'; } cout << name[i]; /*line start here when removing …

Member Avatar for phorce
0
245
Member Avatar for kyle.mace.35

Okay so I have fstreams that I swap between output and input. Is there anyway I can tell which openmode the fstream is in?

Member Avatar for deceptikon
0
179
Member Avatar for H_beginner

The maximum size of my array is 20 but I want the array to display only items that have been entered. I dont want the zeros to be considered in the array in all my operations like sorting and printing etc. Can anyone help. #include<iostream> #include<iomanip> using namespace std; void …

Member Avatar for Banfa
0
451
Member Avatar for thomasbeecher

I have completed this project for my Computer Science I class. I received full credit because the program is functional with no issues at a glance. However, upon testing the program again (after it was graded), I found that under specific circumstances an infinite loop occurs. I couldn't go on …

Member Avatar for NathanOliver
0
758
Member Avatar for rookieNeedsHelp

I have running totals of int minutes and int seconds and I can display them as mmm:sss, but I need to convert them into hh:mm:ss. Any ideas? Thanks in advance for your help.

Member Avatar for rookieNeedsHelp
0
390
Member Avatar for charming-_-eyes

Hello ,,, Please I need Your Help as soon As Possible.. I have an array of integers and i need to convert it to string ... PlZ Help me as soon as Possible ...

Member Avatar for Satya Raj
0
500
Member Avatar for rookieNeedsHelp

How can I convert a string into an integer? I tried this: totalMins += atoi(MovieRecord->getMinutes()); Which I think only works for C-strings, and I tried this: totalMins += static_cast<int>(MovieRecord->getMinutes()); which I think only works for converting an int to a double or something similar.

Member Avatar for rookieNeedsHelp
0
261
Member Avatar for Xakzi

Hello peeps! I need some help to decrypt my text file and make it able to read in my program.. What I have programmed so far is to read the encrypted file, create a new file, decrypt it and read the newly created file.. I need to decrypt the encrypted …

Member Avatar for Ancient Dragon
0
459
Member Avatar for sarah.mathieson.7

I have two function in the same class. In the first function I return a value, and I need to use this value in another function. I am returning by value. double Loan::monthlyPayment(double anAmount, double anInterestRate, int term){ double payment = ((anAmount * anInterestRate ) * ((anInterestRate +1)/((anInterestRate +1)*exp(term)-1))); return …

Member Avatar for sarah.mathieson.7
0
235
Member Avatar for skyyadav

I have to write a program in which i have to remove from a string another string if it found. for ex "I am going to school" and second string is "cho" i have to remove cho from first. the output should be "I am going to sol" need help

Member Avatar for tinstaafl
0
142
Member Avatar for programer.cpp

hi, i'm new C++ programer .i wanna find a way to change process name in task manager when it start(example: proc.exe to changed.exe in task manager) tnx for our attention and answers, your new friend Tjsdeveloper.

Member Avatar for programer.cpp
0
3K

The End.