49,757 Topics

Member Avatar for
Member Avatar for tgreiner

I am using fstream to open and close a file. The code works OK, except the the file does not close when I close it the first time. I need to invoke close twice. Any idea why? And, what this is saying about my code that I do not realize?? …

Member Avatar for Moschops
0
779
Member Avatar for Phoeboo

Little bit confuse on how can I turn this if else statement to a do while statement. Need some help.. #include<iostream> using namespace std; int main() { int div1,div2,rem,num; int count1=0,count2=0,sum1=0,sum2=0; system("cls"); cout<<"Enter divisors : "; cin>>div1>>div2; cout<<"Enter remainder to search : "; cin>>rem; cout<<"Enter number 1 : "; cin>>num; …

Member Avatar for tobyITguy
0
309
Member Avatar for Curious Gorge

I've been working on this project for about two weeks now. Essentially it checks the date, finds events for the day, tells you about them and even lets you plan new ones. Thinking this would be a great deal easier than it became, I thought I would have gotten further …

Member Avatar for Frederick2
0
465
Member Avatar for Nino_1

[Click Here](https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xta1/v/t1.0-9/11062032_934388023272240_5568390880935797936_n.jpg?oh=74464ac9ad5590c8595312bd6737b780&oe=55FC4564&__gda__=1442907117_9cbf40a25436808a834b2bf63856957b) 2<=n<=15

Member Avatar for Stuugie
-2
46
Member Avatar for kww228

I am writing a program that will implement an ADT for polynomials of the form: c0+c1x+c2x2+c3x3+… Each Polynomial object will save the appropriate coefficients for a single polynomial. I think that I have the code doing the right things, however I am getting the following undefined reference errors: undefined reference …

Member Avatar for Moschops
0
1K
Member Avatar for ahmediqbal

hello all, i am a beginner, in C++ we declare varables for example just like(int (variable);. and after this we put some value to variable. but i want that system suppose a variables itself and prompt for a variable just like prompts for value.

Member Avatar for ahmediqbal
0
169
Member Avatar for basit_3

i'm making a programme in which there is a button to save new text file to disk, i make a programme but it not work help me what is the error i cant understand this private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { String^ add=textBox2->Text; String^ final=add+".txt"; ofstream save(final); save.close(); }

Member Avatar for NathanOliver
0
177
Member Avatar for kiran_8

write an program to input elemants in 2d array and display this in matrix form

Member Avatar for NathanOliver
-3
102
Member Avatar for nitin1

I read many articles on Web regarding this. I am able to understand what static_cast does. I am not to properly understand why, and when we have to dynamic cast. There is something "we can downcast the pointer when it is polymorphic". I am not able to understand what they …

Member Avatar for mike_2000_17
0
5K
Member Avatar for PETRICIAMARYMALLIGA A

What is a Structure ?? and write a c++ program to find the grades of the students using structures???

Member Avatar for vegaseat
0
127
Member Avatar for robski

Hi. I,ve got some very helpfull advice from various experts on here and have nearly finished my program but am having a problem with a do while loop. When i try to put a do while ( the input isn't numbers one to ten) loop on a certain part of …

Member Avatar for ROMEO VINEET
0
357
Member Avatar for TObannion

Okay, here I am again. I searched the forum and found the posts that I need to solve this password validator, but I'm not putting it together in my head correctly for some reason. I haven't started the isUpper, isLower, and isDigit functions, but I'm going to do those next. …

Member Avatar for ROMEO VINEET
0
3K
Member Avatar for tahir.hassaan

plz hlp me to construct a program to find the reflexive ,symmetric and transitive relations of Discerete Maths.........

Member Avatar for ROMEO VINEET
-1
90
Member Avatar for preslav_milev

Hi. I need to write a program that finds the shortest route in directed graph. Please look at the picture. [Click Here](https://goo.gl/photos/uRdTfp9pDrAobun87) Here is my code: #include <iostream> using namespace std; const int N = 10; struct elem { char key; elem *next; } *g[N]; void init(elem *g[N]) { for …

Member Avatar for preslav_milev
0
1K
Member Avatar for vbx_wx

[CODE] void HandleConnection() { cout << "You are connected !!!" << endl; char temp[30]; Recv(temp, sizeof(temp)); if(temp[0] == 5) // test for version { cout << "Version good" << endl; char* reply = new char[2]; reply[0] = 5; // version reply[1] = 0; // method choosed (no auth required) Send(reply, …

Member Avatar for Jake_7
0
20K
Member Avatar for Iyappan_1

How to read the Serial port data ? apart from WinUSB or Win32 method in C++.I'm also Search the internet ,But i didn't get any idea . So if any other way to read the Serial port in c++ ? please explain me..........

Member Avatar for gusano79
0
210
Member Avatar for Farhan_8

#include <iostream> #include <cstdio> #include <conio.h> using namespace std; main() { FILE *fp, *ft; char another, choice; struct student { int id; string name; int age; char gender[7]; string address; string blood_group; string doc_name; int amount; char op_tr[1]; }; struct student e; int xid; int recsize; int ifound; fp=fopen("users.txt","rb+"); if …

Member Avatar for David W
0
217
Member Avatar for Prabhu_3

Write a function in C++ which accepts an **2d array and its size** as arguments/parameters and exchanges the values of *first half side elements with the second half side elements of the array.*

Member Avatar for David W
0
90
Member Avatar for sunshine1020

Please ,could you explain this sentence The wins should be input in a parameter-less value returning function that returns the wins to the main function returning function just returns value and does not print message , right ? #include<iostream> using namespace std; int wins(int wins) { cout<<"Please input the number …

Member Avatar for sunshine1020
0
708
Member Avatar for Baalla

i don't know where is the problem or wha i'm missing here but i'm stuck in an infinite loop when i compile it keep desplaying these two cout cout << "\ntotal weight of neighbors of "<< *it <<" is " << " "<< W; cout << "the selected node with …

Member Avatar for Baalla
0
258
Member Avatar for marsimoi tolesa

Write a program that takes length as input in feet and inches. The program should then convert the lengths in centimeters and display it on screen. Assume that the given lengths in feet and inches are integers. Based on the problem, you need to design an algorithm as follows: 1. …

Member Avatar for Schol-R-LEA
0
439
Member Avatar for lamlomeh

Write a function to take an integer and two character. Your function should draw a shape similar to the one below. For example: DrawShape( 5, '#', '*') Outputs the following *#### #*### ##*## ###*# ####* p.s: (without the(. at the begining) i added cous the shape wont set right if …

Member Avatar for David W
0
145
Member Avatar for lamlomeh

**5. Consider a data file named STORES.DAT, which contains inventory information for four shops. Each line in the file contains the inventory of five types of merchandize in each store. Write a program to perform the following: (a) Read the data into a two-dimensional array invent(4,5). (b) Produce the output …

Member Avatar for David W
0
229
Member Avatar for Asira18

#include <iostream> #include <conio.h> #include <string> #include <windows.h> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { char bname[97],number[34],code[22], name[10],bcate[10],pass,book,author,ID,school,course ; char type, address[5],x,department,quantity,choice,date[10],aname[20],btitle[50], bcode[9] ; int getch(); int num1,num2,num3,num4,num5,num6,num7,num8,op,a, ph[20],num,i=0; int …

Member Avatar for Asira18
0
377
Member Avatar for Fredy_2

#include<iostream> #include<ctime> #include<iomanip> using namespace std; int totcount(int,int,int); //function prototype void sandtype(int&,int&,int&); //function prototype void profitandcost(double&, double& ,int ,int ,int ,int ,int ,int ,double, double); //function prototype //function main begins program execution int main () { int sandwichtype, deliverytime;// declare variables int grandtotalinlbp, grandtotalinusd; int sandwichcost1, sandwichcost2, sandwichcost3; int sandwichretailprice1, …

Member Avatar for Fredy_2
0
118
Member Avatar for Alveena_1

.1 Develop a complete C/C++ program which will sort the input array of integer having a maximum of 10 elements in “Descending Order”. (15 Marks) Your program should give a menu to the user after reading the input. The menu must be following: Press 1 to sort using merge sort …

Member Avatar for ddanbe
-2
253
Member Avatar for munchlaxxx

Any ideas of how I can have a calendar for all 12 months print for any year? The user inputs the year and the day of the week for January 1st of that year. (Sunday = 0, Monday = 1, etc.) *Important*: I cannot use cases. (That's what I've mostly …

Member Avatar for 0igo
0
17K
Member Avatar for Baalla

hello there i'm having a list iterator not incrementable problem i have a adjacency matrix "adj(2d vectors)" + i have a char vector in name color and i have a int glist i'm having a problem with the following function for(list<int>::iterator it = glist.begin(); it != glist.end(); it++) { int …

Member Avatar for Moschops
0
350
Member Avatar for Asira18

#include <iostream> #include <conio.h> #include <string> #include <windows.h> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { char bname[97],number[34],code[22], name[10],bcate[10],pass,book,author,ID,school,course ; char type, address[5],x,department,quantity,choice,date[10],aname[20],btitle[50], bcode[9] ; int getch(); int num1,num2,num3,num4,num5,num6,num7,num8,op,a, ph[20],num,i=0; int …

Member Avatar for tinstaafl
0
262
Member Avatar for nitin1

Hi, I am learning Git system these days. I have made a new folder in ubuntu and in terminal did this: 1. git init 2. then made a file testfile1.txt 3. then made a branch using "git branch newbranch" 4. then checkout to this branch. 5. then, made a new …

Member Avatar for sepp2k
0
204

The End.