49,761 Topics
| |
This is another homework problem. I thought it was easier, and I wouldn't need help, but I keep getting a segmentation fault when running the program. The assignment is to use a recursive function to output the amount of candybars we can buy with a user-inputted amount of money. Each … | |
hi, i having some problem here. I have a DLL written in C# but I need to re-write it in C++ using visual studio 2005. I have no C++ language..o.O so could some one help guide me? help translate my code..should i use new project > 'Class Library' project or … | |
hello , i'm trying to solve this problem [QUOTE]Create a program which generates fibonacci series till a number 'n' where 'n' is entered by the user. For eg. if the user enters 10 then the output would be: 1 1 2 3 5 8 (beginner)[/QUOTE] the problem is that the … | |
I have a file that has the layout: [CODE] 0 0 0 1 1 0 1 1 [/CODE] I want to read it into a multidimensional array and use the values. The thing is I don't know how to read it in.. I can read the amount of columns and … | |
Hello all, I have created an array of linked lists called hash_array[]. I am trying to write a search function. I am getting compiler errors on line 7 & 9. They are below. Line 7 warning C4018: '<' : signed/unsigned mismatch Line 9 error C2784: 'bool std::operator ==(const std::list<_Ty,_Ax> &,const … | |
Sorry to post this here How do I write a query to double the `buyprice` of every item that costs less than 20US. Can someone help me with this please. I had UPDATE Account SET buyprice This is where i got stuck been searching google but couldnt find it | |
[CODE]#include<iostream> using namespace std; int main() { int num,factorial(int n) ; cout<<"Enter a number "<<endl; cin>>num; } for(n=0;n<100;n++) { cout<<""<<n<<endl; system("pause"); }[/CODE] where i do wrongly? why i cannot compile? | |
i made a program in dev c++ to merge contents of two files into a single file but the merged file is showing garbage outputs. question:- Write a C++ program to merge the content of two files namely “Employee.txt” and “Salary.txt” into “EmployeeDetails.txt”. Sample contents of Employee.txt EmployeeName EmployeeNumber Department … | |
So, it sorts the books by price just fine, but I cannot get it to sort the books by title. I am most likely over thinking this, but I've spent a couple hours trying to figure it out. I've looked online and couldn't find the answer. I'm guessing the problem … | |
Hello all, I am trying to write the constructor for the HashTable class, so it will create an array when a HashTable object is created. With the code below, I am getting the errors: error C2466: cannot allocate an array of constant size 0 error C2133: 'arrayTest' : unknown size … | |
very dificult oop, exception, inheritance task pleas. sorry, i'm hope you understand me. | |
[code]#include<stdio.h> #include<stdlib.h> main() { float num,a,b,c,d,e,f; do { scanf("%f",&num); getchar(); } while (num>=0.75); a=0.0; b=0.0; c=0.0; d=0.0; e=0.0; f=0.0; if (num%2.0!==0) { a=num/2.0; num=num%2.0; if (num%1.0!=0) { b=num/1.0; num=num%1.0; if (num%0.50!==0) { c=num/0.50; num=num%0.50; if (num%0.20!==0) { d=num/0.20; num=num%0.20; if (num%0.10!==0) { e=num/0.10; num=num%0.10; if (num%0.05!==0) { f=num/0.05; } } … | |
I'm trying to sort an array of numbers in ascending order and don't know whats wrong with my code (I'm completely new to vectors). I should first copy the input array (data) into an STL vector, then apply STL’s sorting algorithm to the vector, and finally copy the vector back … | |
Hi can u help me to listing number of file systems that have sizes between 1k to 10k and 10k to 100k ... in c++? I need it soon Thanks alot | |
Hello all, Lots of code here, but much of it can be ignored. I am getting an error on line 34 of HashTable.h, stemming from line 50 of main.cpp. I am trying to create an array of lists in the HashTable.h file. Error code is: \HashTable.h(34) : error C2440: '=' … | |
I'm trying to determine if this creates an array of pointers, with the array size being "size"? Is this correct? [CODE] int size = x; int *ptr; ptr = new int [size]; [/CODE] | |
Studying modern c++ design, looks like Typelist is a very important tool for generic programming. Could I find something like Typelist from boost? I found something like boost::mpl but I didn't see anything like Nulltype defined in loki Could boost::mpl replace the Typelist of loki? Thanks | |
I don't my deduction of NoDuplicates are correct or not please correct my error if I did [code] template<typename TList> struct NoDuplicates; template<> struct NoDuplicates<NullType> { typedef NullType Result; }; template<typename Head, typename Tail> struct NoDuplicates<Typelist<Head, Tail> > { //private : typedef typename NoDuplicates<Tail>::Result L1; typedef typename Erase<L1, Head>::Result L2; … | |
Hello (Dunno if this is the right forum) But basically, I've been given some text to decrypt. I've got to do it using frequency analysis. Here's what I've done: 1. Got a frequency analysis of the text: Showing how many times a letter appears. 2. Got a frequency analysis of … | |
i have follwoing code in c++ .i want to continue it till suer give input as 'Y' or 'y' [CODE]// my first program in C++ #include <iostream> #include <stdlib.h> #include <conio.h> #include <stdio.h> //#inlcude <iostream> #include <stdlib.h> #include <conio.h> #include <ctime> using namespace std; void Evaluatexp(char ch[]); //void Evaluatexp(string ch); … | |
I have function which I have created a DLL for. I'm trying to call this function from a C++ program using some code I found online. I know the code works fine when the function in the DLL uses the convention call [ICODE]__stdcall[/ICODE], however, I don't want to use this … | |
Hello, I need to take a four digit integer and re-arrange it as follows... pre: 1234 post: 3412 I have been searching for a method to convert a char array to an int, so I can use the code below. Am I using atoi() incorrectly? The result I get when … | |
I've been Programming in C++ for a year. I am done with Basics and all other OOP concepts(like inheritance,polymorphism and STL) I want to be a game programmer, but i don't know what to study now? I've heard about OpenGL, DirectX, GUI libraries as a result i m confused to … | |
Hello, I have an array and need to sort it so that the highest numbers show first etc.. I have written this: [code] for(int i=0; (i < 26); i++) { while(counter[i] < counter[i + 1]) { int temp = counter[i]; counter[i + 1] = temp; counter[i] = counter[i + 1]; … | |
Hey.. Is it possible to make PHP type arrays? Like keys? For example, I have an array of numbers, and an array of letters.. A = 10 B = 20 C = 30 And then I sort the numbers so that the highest number is at the top etc.. But, … | |
Can any one help me put my pointer by gotoxy function inside the matrix that,s like as below: [CODE]void gotoxy( short x, short y ) // function to handle position of cursor on the screen { HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); COORD position = { x, y }; SetConsoleCursorPosition( hStdout, position … | |
hi; I'm trying to program a circular link list with a head node , I have a problem with insert function . wanting to do it like this but with a head node >> [url]http://geeksforgeeks.org/wp-content/uploads/cll1.gif[/url] this is my function :: [CODE] struct node{ int data; node *next; node(int x,node *n=NULL){ … | |
The names are in a txt. file and are categorized as 1. malename femalename. One being the number symbolizing their popularity in 2004. What I've been attempting to program is a program that will read a requested baby name from the user. Scan through all the baby names using an … | |
Hello everyone, my assignment is to calculate each student's test average and final letter grade from a class of 20 students with 3 tests. The scores for each test are located in the text files that I am attaching. I have worked on this code for some time now, but … |
The End.