51,593 Topics

Member Avatar for
Member Avatar for Ihteshamullhaq

#include <iostream> using namespace std; main() { int matrix[2][2]; for (int i = 0; i<=2; i++) { for (int j = 0; j<=2; j++) { cout <<"Please Enter matrix "<<i<<"th row and "<<j<<"th Column "; cin >>matrix[i][j]; } } //Display the Matrix for (int i = 0; i <= 2; …

Member Avatar for basit_3
0
128
Member Avatar for basit_3

guys how to make templete , or any link to tutorials of templete in c++

Member Avatar for Moschops
0
178
Member Avatar for basit_3
Member Avatar for niski

Hey guys, I've started building a program for college, everything was running really smooth and I've started to pick things up in the past couple days, but for the life of me I cannot find where I have a syntax error, neither can my friends :/ I've tried looking up …

Member Avatar for niski
0
230
Member Avatar for kiail

Okay, so I've got a carpet calculator program. It figures feet, calculates cost. I have a class named RoomCarpet that I receive the error C2228 left of '.getFeet' must have a class/struct/union in the .cpp file. I'm declaring in RoomCarpet.h and trying to implement in RoomCarpet.cpp. I have the .cpp …

Member Avatar for kiail
0
232
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
793
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
324
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
468
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 dbfud1988

Doing simple domain name search Just enter sometimes Segmentation fault I really do not know how to solve this problem But some can be found ip i not idea Read what information can solve this problem I'm sorry my English is very poor

Member Avatar for dbfud1988
0
305
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
171
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
180
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
131
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
374
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
91
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
212
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
220
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
93
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
718
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
264
Member Avatar for Djmann1013

I am trying to make a MP3 player using axWindowsMediaPlayer, and I am running into some issues. When the song stops playing, it is supposed to go on to the next song in the list, but instead it locks up. I don't know how to fix this, I tried googling …

1
269
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
443
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
148
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
233
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
400
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
119
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
257
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
358
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
274
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
206
Member Avatar for Dusan_1

Write a program that modifies a given sentence by the last word to the beginning of sentences.To consider that words are separated by exactly one with blank sign.A sentence in the form of string set by the user.Show modified string.

Member Avatar for Schol-R-LEA
0
268
Member Avatar for markdean1989

Why is it that whenever I use the getline function I get an error during execution. To clarify... I have this code; cout<<"Enter your string: "; getline(cin, myString); //line 1 cout<<"Enter your name: "; getline(cin, myName); //line 2 cout<<"Age: "; cin>>age; //line 3 output: ____________________________ Enter your string: gfgfkjhjkhgg Enter …

Member Avatar for David W
0
2K
Member Avatar for cannon_1

I have a code that can be compiled fine on the server but not on my mac machines. The following code is designed to split the reading text according to the string delimiter. But when trying to compile this on my mac, I have issues. void split_is(const std::string &s, string …

Member Avatar for rubberman
0
808
Member Avatar for basit_3

hello guys i have to make a simple game project , i not know game programming , any body help me where to start game programming

Member Avatar for Schol-R-LEA
0
230
Member Avatar for nicky nelson

Write a program that displays length of each name stored in a 2D character array. You may assume that 10 names are being stored in the 2D character array at a given time and the length of the name may not exceed 30 charatcers.

Member Avatar for David W
0
196
Member Avatar for basit_3

guys i making a programme in this i have to merge two arrays into one new array but this code does not run at run time ,compiler does not chow any error int k[100][100]; for (int i=0;i<n;n++) { k[i][i]=k[array_1[i]][array_2[i]]; } for (int i=0;i<n;i++) { cout<<k[i][i]; } here array_1 is my …

Member Avatar for ddanbe
0
199
Member Avatar for Baalla

hello i have an adjancy matrix for example [0] 0,44, ( 0 : node / 0,44 it neighbors) [1] 1,3,12, [2] 2,33,40, i need to remove all of the neighbors from a list and push them in another one i wanna start from adj[specific number].begin to adj[specific number].end to remove …

Member Avatar for rubberman
0
278
Member Avatar for basit_3
Member Avatar for liyanaddsce

Hello!!! I am a beginner to C++ and linked list and searching algorithm really made me confused. There are 26 errors (which caused by pointer ofc). Can anyone give me idea how to fix these errors??? #include<string> #include<cstdlib> #include<iostream> #include<malloc.h> #include<fstream> #include<time.h> #include<conio.h> using namespace std; #define SIZE 10 class …

Member Avatar for Moschops
0
274
Member Avatar for Asira18

Please can someone help me write a simple password program for my program which prints out in stars(*).Thank you.

Member Avatar for David W
0
372
Member Avatar for aymenchouikh

Hello i'm using visual studio 2010 express. I'm beginner. I'm searching how to design a button and to program it ? Thanks for any help

Member Avatar for ddanbe
0
413
Member Avatar for TObannion

So, I'm working on an assignment. It involves a read-in text file and the program itself. When I run it I get what my teacher would call "garbage" in the output. Here is the info from the .txt: Mike 1200 John 350 Jen 1500 Tara 700 Michelle 2000 Kevin 500 …

Member Avatar for TObannion
0
261
Member Avatar for LONGWAY

I have to do this with "for" and "while" loop in c++ but no idea how print all numbers between 10000 and 100 which are devisible with 5 and 9 but not with 2 any help suggestion advice or anything is needed urgently this is too complicated for me heelp

Member Avatar for Schol-R-LEA
0
142

The End.