49,761 Topics
| |
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 … | |
What's wrong with this code because I'm getting errors but everything looks fine though. | |
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??? | |
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 … | |
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. | |
#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]; … | |
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 … | |
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 … | |
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++. | |
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 … | |
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. | |
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 … | |
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 … | |
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, … | |
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: … | |
t to do something like [code] void f1(int a[][]) {//do smth } //and call the function like this F1({{1,0},{2,5}});[/code] | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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] … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.