49,761 Topics

Member Avatar for
Member Avatar for princessophia

For this assignment, I am supposed to get a starting population, an annual death rate, an annual birth rate, and the number of years to display. I am then supposed to use these values in the formula n = p*(1 + b)*(1-d), where n is the projected population, b is …

Member Avatar for Moschops
0
194
Member Avatar for Tewhano

This is homework so I am not looking for a better way to do this. I am only asking for a second pair of eyes to spot my mistake. I have a function that takes a two-dimensional array and fills the first row with the elements from a one-dimensional array. …

Member Avatar for Tewhano
0
208
Member Avatar for maiza.razzaq

//write a program whih takes input until user enters a negative number. print the sum of given inputs. #include <iostream> using namespace std; int main () { int a[10]; cout << " enter numbers " << endl ; int i = 0 ; while ( i < 10) {while (a[i] …

Member Avatar for nullptr
0
283
Member Avatar for devourer17

#include<iostream> #include<cstdlib> #include<string.h> using namespace std; template<typename X>class list { X *l[10]; public: void insert(X *ele); void display(); }; template<typename X>void list<X>::insert(X *ele) { static int i; l[i]=ele; i++; } template<typename X>void list<X>::display() { static int i; cout<<"\nThe Name #:"<<i<<"\t"<<*l[i]<<endl; i++; } int main() { string s; list<string> l1; cout<<"\nEnter …

Member Avatar for devourer17
0
115
Member Avatar for Robin_3

I have a task to disply user entered values in a single line while using cin and cout objects. Any one can help me to understand this?? My question is when a user enter a value in any veriable, cursor sholud not move to the next line... Please help if …

Member Avatar for Ancient Dragon
0
477
Member Avatar for curt.owens.5

I have an assignment due at 8:00PM. I've had a ton of work to do this week and haven't really got to learn the topic before the assignment. I'm just trying to get the points for the assignment and learn the stuff after its due. Problem: You are to create …

Member Avatar for Ancient Dragon
0
150
Member Avatar for skyyadav

In my program the commands are on left hand side , I want to move thses buttons to middle of window on click of mouse. I wrote this code n=but buttons are disappearing. Any solution case WM_LBUTTONDOWN: RECT buttonScreenRect; GetWindowRect(hButton, &buttonScreenRect); POINT buttonClientPoint; //buttonClientPoint.x = hButton.left; buttonClientPoint.x = buttonScreenRect.left; buttonClientPoint.y …

0
116
Member Avatar for sparsh610_1

#include<stdio.h> #include<stdlib.h> #include<iostream.h> #include<string.h> void main(){ FILE *fp1,*fp2; char *a,*b; int num; fp1=fopen("myfile.txt","r+"); fp2=fopen("myfile.txt","a+"); cout<<"enter the number of names you want to enter \n"; cin>>num; a=(char*)malloc(80); b=(char*)malloc(80); while(num){ gets(a); fputs("\n",fp2); fputs(a,fp2); num--; } cout<<"\n diplay the names"; while(!feof(fp1)){ fgets(b,80,fp1); cout<<b; } /* //code to search string a in file ... …

Member Avatar for Ancient Dragon
0
108
Member Avatar for FairyA

I have search though multiple similar topics but still can't find the answere. Would you please help ? The error is : **invalid initialization of reference of type 'ArrayT<float>&' from expression of type 'const Arrat<float>'** The above errors occur when I tried to do the following code , with operator* …

0
106
Member Avatar for illyaizevielvon.einzbern

Guys, can you help me with my project I can't see what's wrong with my program. The errors are: Line 138: Expected primary-expression before "int" Line 138: Expected ';' before "int" Line 158: Expected '}' at end of input #include<iostream> using namespace std; int telephone_bill() { int choice, min, tbill, …

Member Avatar for ikel
0
276
Member Avatar for Xakzi

Hello! I am coding in windows form application c++/CLR I need help with coding a way to read everything in a folder, put the names of the files and put the names in a combobox. These files are for now images (.jpeg). And I would also like that, when I …

Member Avatar for Xakzi
0
758
Member Avatar for New In C++

**I Have Problem Making This Program .Anybody please make this program for me.THANKS** Write a program to calculate a^b without using any built in function. The values of a and b are to be taken from the user.

Member Avatar for ikel
-1
106
Member Avatar for Danja

Hello, I am trying to interface with a laboratory instrument using C++. I realize that my C++ experience falls short of desirable for this task; I am a self-taught amateur C# programmer delving into C++ and much of the code I have written is new to me. However, I have …

Member Avatar for Moschops
0
562
Member Avatar for naamurad

I have been looking for Prim Algorithm on daniweb.com website and I found multiple threads dead but still unsolved. Few people needs expalination of Prim Algorithm and others need its working code. Well, to help everyout out, here is a link to working Prim's Algorithm code which is easier to …

Member Avatar for naamurad
0
248
Member Avatar for zahid_3

#Include<fstream> #include<> #include<iostream> #include<string> using namespace std; int main() { string str="time is a great teacher, but unfortunatly" "it kills all its puplis. Berlioz"; ofstream outfile("ali.TXT");//ERROR for(int j=0;j<str.size();j++) outfile.put(str[j]); cout<<"file written\n"; //system("pause"); return 0; } please correct my code"ofstream outfile("ali.txt")"

Member Avatar for nullptr
0
115
Member Avatar for numbplum

**** Hey guys, I really need help on this. I just submitted my exam but I won't get feedback till next week. I'm hoping that you guys can help me review. Thanks! Question 1 For each non-static data member of a class, C++ allocates only one memory space. Question 1 …

Member Avatar for rubberman
0
826
Member Avatar for younes.keraressi

when i uncoment this line 144; i have error , and i debug and it was good, can anybody help me why i got this kind of error mybe should i declare List<employ>* list2, but it must wrok good like normale way List<employ> list2 #include<iostream> #include<fstream> #include<string> using namespace std; …

Member Avatar for younes.keraressi
0
178
Member Avatar for mohammed.alrasheed.353

In this exercise, you will create a program that adds, subtracts, multiplies, or divides two integers. The program will need to get a letter (A for addition, S for subtraction, M for multiplication, or D for division) and two integers from the user. If the user enters an invalid letter, …

Member Avatar for bradly.spicer
0
298
Member Avatar for andrew.mendonca.967

CSCI 15 Assignment #3, introduction to classes/objects. 100 points, due 10/21/13 A mixed expression is an expression of the form a + b/c, where a, b, and c are integers, b >= 0 and c > 0. By convention, b/c is always non-negative, and has the property that 0 <= …

Member Avatar for tinstaafl
0
245
Member Avatar for laklaker

Good day! I would like to ask on how to reverse arrays and putting it on another array of char? string str; int k=0, count = 0,namelength, acc=0; char name[80]; char extract[80]; char reversing[80]; for(int j=0; j<strlen(extract);j++){ reversing[strlen(extract) -j]= extract[j]; } for(int w; w<=strlen(extract);w++){ cout << reversing[w]; } Is it …

Member Avatar for Ajit_2
0
260
Member Avatar for cambalinho

class test { virtual void created(){}; //i must do these. //or when i call the function the compiler give me an error test() { void created(); } }test; void test::created() { cout << "hello world"; } these code have 1 error. but how can overrride the created function?

Member Avatar for cambalinho
0
408
Member Avatar for Masood_786

Hi All, I want to grab TV Tuner Raw Samples for implementing FM receiver. I need to have mechanism to Tune desired frequency and then grab Samples of that frequency, in this case it would be IF samples and then implement FM receiver over it. I have already seen various …

Member Avatar for abbott@lantic
0
977
Member Avatar for GeekPlease
Member Avatar for Andy90

I m trying to convert C code to C++. Facing some difficulties help me out! //This is struct typedef struct index { int id; char word[20]; int count; }indexs; // Function prototype void fileScanner(FILE * ifp,int i); void fileRead(FILE *ofp); int findString(char s[],char u[]); int searchEntry(indexs [],char key[],int n); void …

Member Avatar for Schol-R-LEA
0
224
Member Avatar for andrew.mendonca.967

CSCI 15 Assignment #3, introduction to classes/objects. 100 points, due 10/21/13 A mixed expression is an expression of the form a + b/c, where a, b, and c are integers, b >= 0 and c > 0. By convention, b/c is always non-negative, and has the property that 0 <= …

Member Avatar for nullptr
0
221
Member Avatar for tooota

hi all, i want to start building an authentication server which authenticates the clients to the e-commerce web site . do i need -for example- apache server,or WAMP and then write my code on it, i've not did a server side prgramming before.iam going to use Qt . i don't …

Member Avatar for tooota
0
210
Member Avatar for Andy90

Hi, I m facing difficulties in replacing this C code with C++? For e.g : Can we use Fopen in C++? Please suggest me changes here to make it c++ equivalent! How to write this in C++ --> void fileRead(FILE *ofp); void fileScanner(FILE * ifp,int i); void fileRead(FILE *ofp); int …

Member Avatar for mridul.ahuja
0
510
Member Avatar for skyyadav

I have to write a fn squeeze(const string &s, char c) for ex squeeze("haaaaah" , 'a') should give the output hah

Member Avatar for mike_2000_17
0
1K
Member Avatar for TalentedIndividual

hello fellow programmers, i am doing an assignment for class and i am having a bit of trouble. So the assignments reads Given two sorted (in ascending order) lists of size M and N, write an O(M+N) algorithm to find the sorted (also in ascending order) union of the two …

Member Avatar for tinstaafl
0
532
Member Avatar for H_beginner

I am new to classes and was trying to create an elmentary program to understand classes and objects. I ve created three files 1) header file for class declaration 2) class definition .cpp file 3) class implementation main .cpp file I cannot understand the error I am getting. Please help. …

Member Avatar for tinstaafl
0
224

The End.