49,761 Topics

Member Avatar for
Member Avatar for nchy13

i am working with g++ in linux ubuntu i am attaching input file for which error occurred. this file tries to insert 1000 numbers and then 250th smallest number. this code worked well when i inserted less numbers but it is not working for insertion of 1000 numbers. compiler shows …

Member Avatar for nchy13
0
172
Member Avatar for Cross213

What's wrong with this code because I'm getting errors but everything looks fine though.

Member Avatar for Cross213
0
95
Member Avatar for vergil1983

Hi all, just a curious question... Why pointers are used in C++ or other languages in order to produce a much higher "quality" code and in open source programming???

Member Avatar for MonsieurPointer
0
125
Member Avatar for dkXIII

I have received cipher documents which are believed to be secret messages. So, my mission is to break the encoding and reveal what the secrets are that each file contains. However,it is believed that each file contains a message protected with a "null cipher" which surround the real characters in …

Member Avatar for raptr_dflo
0
192
Member Avatar for fatzky_04

Hello! Can you please help me understand these problem. I don't have any idea what is the supposed output. Given a matrix M stored in array m[10][10]. Check if M is lower triangular, i.e. every element below the main diagonal is zero.

Member Avatar for StuXYZ
0
91
Member Avatar for _electricblue

#include <iostream> #include <fstream> #include <cstdlib> using namespace std; const int numRows = 22; // Number of rows in the board const int numColumns = 80; // Number of columns in the board int row; int column; char Drawing[numRows][numColumns]; // environment representing all the cells and their state. char point[6]; …

Member Avatar for mazzica1
0
873
Member Avatar for truss86

Hello! I am working a programming assignment and the goal is to turn the static arrays into dynamic arrays. The program reads in a file of names, votes and outputs the winner and number of votes. I have the first dynamic array for votes complete, but I am having trouble …

Member Avatar for mazzica1
0
177
Member Avatar for dakerao

Hello this is my problem below How would i do this: Got a text file called directorycontents.txt in this directorycontents.txt there is a bunch of text each one is a filename with a filename extension i want to be able to go like this if there is a filename extension …

Member Avatar for WaltP
0
191
Member Avatar for nchy13

hi all!! i wanted to know the name of book which covers all the basic syntax and concepts of java keeping in mind that i have the basics of c++.

Member Avatar for stevanity
0
116
Member Avatar for physicsg

Hey. I have just joined and my skills in C++ are more or less no existen but still better than me trying to learn python or smth which supposedly is more adequate for the task as i am told. Any way I have a data file which consits of observational …

0
44
Member Avatar for rrr12345

Hello, I have made a store inventory system in console in C++. I would like to know how can i convert it into full fledged graphical user interface. Any article,book,tutorial,video would be very helpful Thank you.

Member Avatar for rrr12345
0
224
Member Avatar for DeusManP0W

My problem is as said "expected ';' before "int" " I dont the problem => This obviusly aint the hole text, rather its the place where its complaining. [CODE]int tarning2(void) { return(tarning1()+tarning1()); } int tarning1(void) { int max = 6, min = 1; return (rand()%(max-min+1)+min); }[/CODE] This might have something …

Member Avatar for DeusManP0W
0
1K
Member Avatar for salah_saleh

Hi!, I have a text file that contains a 2 dimensional matrix, and I will have to deal with many different files with different matrix dimensions, so I decided to use vector of vectors as they double their size automatically. the problem is that I don't know how to get …

Member Avatar for salah_saleh
0
6K
Member Avatar for jdm

I'm working on a program that lets the user draw squares or circles in any size (as long as it fits the window) and in a selection of color. I want to limit the number of objects that the user can draw to 10 and be able to select, move, …

0
70
Member Avatar for nchy13

don't go by the size of code. [U]before inserting search function my code was working fine with insert function. but don't know what is wrong with search fn. or declaration of variables in main().[/U] [B]this is what compiler shows. tree.cpp:316:15: error: cannot convert ‘int*’ to ‘redblacktree<int>*’ in assignment tree.cpp:318:15: error: …

Member Avatar for nchy13
0
163
Member Avatar for dospy

t to do something like [code] void f1(int a[][]) {//do smth } //and call the function like this F1({{1,0},{2,5}});[/code]

Member Avatar for dospy
0
119
Member Avatar for delifion

Hi, this is what i'm trying to do [icode] class a { private: string attribute; string p_msg; public: string& getAttribute() { return attribute; } }; [/icode] above is the class, i want to call function getAttribute() from class a is a linked list: list<a*> aa [icode] void sortFile(Manager& manage, const …

Member Avatar for Nasas
0
147
Member Avatar for james6754

So in C# I can create an array of n elements: [CODE] int[] myArray = new int[n]; [/CODE] I have looked and it doesn't seem as though I can create an array like this in C++ (using new). Could anyone please explain why I cannot use new to create an …

Member Avatar for james6754
0
86
Member Avatar for dakerao

Hello this is my problem below How would i do this: Got a text file called directorycontents.txt in this directorycontents.txt there is a bunch of text each one is a filename with a filename extension i want to be able to go like this if there is a filename extension …

Member Avatar for dakerao
0
187
Member Avatar for infantheartlyje

Hi folks, I have written code to random access files in c++ . I got result without creating a method for write a record to the file. I have given the code snippet below. [code] #include<iostream> #include<fstream> #include<iomanip> using namespace std; class student { int rollno,marks; char name[20]; fstream fpointer; …

Member Avatar for infantheartlyje
0
314
Member Avatar for fkrafi

I can compile following code using "cl A.cpp" but i want to compile with an input file A.in and generate output file A.out.. is there any why to do that from cmd.... [B]A.cpp[/B] [CODE] #include<stdio.h> int main(){ int n; while( scanf("%d", &n) ){ if( !n )break; printf("%d\n", n); } return …

Member Avatar for WaltP
0
231
Member Avatar for klw

I am writing code for a C++ class. I have tried a couple of different ways to write it, but I keep failing. Here is what I have so far and also what the assignment asks us to do. Please help You have been asked to write a program to …

Member Avatar for MandrewP
0
147
Member Avatar for snorky

project help! how to make shape like this? (using "while") * * ** ** *** *** **** **** ***** ***** very please, i need help immediately... i can make only one triangle(using "for"), but now i'm gonna make two triangles using "while".... ------------------------------ and this is my triangle(using "for"),, but this is only one shape …

Member Avatar for snorky
0
84
Member Avatar for truetexan

Background: I learned old-school c++ programming techniques, being able to declare global variables before the main() routine. However, in Vis C++, I am having trouble, especially with global arrays. I am programming a Windows Forms application. In it, I declare a global integer array just after all my includes in …

Member Avatar for truetexan
0
231
Member Avatar for Groovemix

I do not under stand how to get NODE to work. Worked fine with typedef struct but when I changed to template stopped working??? [CODE]template<typename T> struct Node { struct Node(T data) { this->data = data; previous = NULL; next = NULL; } T data; struct Node *previous; struct Node …

Member Avatar for Groovemix
0
129
Member Avatar for pendo826

I want to place an object into an array so that when i call the array my stats, inventory objects will show up is it possible ? here is my code: [CODE] void displayStats() { const int SIZE = 11; string stats[SIZE]; status Status = {100,20}; cout << "******Stats******\n"; stats[0] …

Member Avatar for raptr_dflo
0
233
Member Avatar for fsefsef23

Please bear with me as I am awful with pointers. My instructor gave us an assignment whose main focus is inheritance. We have an 'item' class that has 2 classes derived from it, discountItem and taxableItem, the main difference being that they add a tax and a discount to their …

Member Avatar for raptr_dflo
0
98
Member Avatar for jackly94

My Struct was looping and working well, Till i Added in a New Struct and add that to the Loop, Now its not Working that well plus not outputting the Details only the hours. could some one help me with this.. [CODE] struct Trains { int Train_Id; //train ID string …

Member Avatar for raptr_dflo
0
130
Member Avatar for stevo7624

I need help getting through a class I have to take. I know basics but need help with some of the more complictaed issues. For me that is arrays, classes, stacks, and so on. If someone is willing to help I would appreciate it. I could use some more personalized …

Member Avatar for raptr_dflo
0
130
Member Avatar for thecoolman5

hi, I already know how to use setprecision but the function wont let the round go up past 16. [CODE]#include<iostream> #include<stdio.h> #include<math.h> #include<iomanip> using namespace std; int main () { double pi = 3.14159265358979323846264338327950288419716939937510; cout << setprecision(50) << pi << endl; system("pause"); } [/CODE] the output is just 3.1415926535897931 the …

Member Avatar for raptr_dflo
0
3K

The End.