49,761 Topics
| |
Below is my code for Fibonacci sequence, however when I use a large number such as 100 or more it takes forever to produce output. Why? any help would be appreciated. :( [code]#include <iostream> using namespace std; long fib_num ( long ); int main() { long num = 0; long … | |
Ok this is the classic Towers of Hanoi question. Legend has it that in a temple in the Far East, priest are attempting to move a stack of disks from one peg to another. The initial stack had 64 disks threaded onto one peg and arranged from bottom to top … | |
Hi all I need to return four dimensional array of strings during the work of background worker which is receiving data via serial port. In background worker: array<String^>^ Received = gcnew array<String^>(4); BackgroundWorker1->ReportProgress(10,Received); In report progress: private: System::Void backgroundWorker1_ProgressChanged(System::Object^ sender, System::ComponentModel::ProgressChangedEventArgs^ e) { array<String^>^ Received2 = gcnew array<String^>(4); Received2 =(e->UserState); … | |
(Before I ask my question, I have tried looking through google and the site already, and didn't find anything relevant to what my problem was. All I was finding was more complex than my current level.) Anyway, my problem is that I'm getting an "expression must have (pointer-to-) function type … | |
I am not grasping C++ very well and I am having a hard time with this assignment: • Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula Momentum is m=mass*velocity. Your program should consist … | |
I'm obviously typing in the wrong search terms, but I'm looking for a REST application in C# in Web API running on Azure, but with an example of calling that REST C# from a VS2010 C++ application. I have one half (the C# bit) but I can't find any examples … | |
Getting the error LNK2019, eb=everything included Desparate, pls help!!!!!! 1>------ Rebuild All started: Project: ConsoleApplication1, Configuration: Debug Win32 ------ 1> stdafx.cpp 1> ConsoleApplication1.cpp 1>ConsoleApplication1.obj : error LNK2019: unresolved external symbol "void __cdecl mod_rec(void)" (?mod_rec@@YAXXZ) referenced in function "void __cdecl menu(void)" (?menu@@YAXXZ) 1>ConsoleApplication1.obj : error LNK2019: unresolved external symbol "void __cdecl … | |
I am having trouble copying projects, I am using allegro 5 on my course at the moment so it makes completing the exercises faster by creating a default allegro project which has been modified to contain the allegro libraries and such and using this to create new exercises. The way … | |
Would anyone know what the PNG Include directory variable should be for CMAKE. I can't seem to find a Cmake module to search for PNG in the program which depends on LIBPNG (unlike all it's other dependencies). I've been using PNG_INCLUDE_DIR but CMAKE doesn't seem to recognise it? thanks. | |
i need to write a program that ouputs any five positive integers to the screen? for (int i = 1; i <= 5; i++) cout << rand () // what goes here? usually when there's a range (lets say any 3 digit number) i usually do it like this cout … | |
I am having trouble finishing this code for an assignment i have due. I have to create a code that (depending on what the user picks) sorts the numbers in ascending or decending order using an array with the funcion in the code. Any help would be greatly appriciated. #include … | |
Please help me with following problem (I am struggling in a class that I really shouldn't have taken, and I have absolutely no idea where to start, or how to continue with it): Write a program that can be used to assign seats for a commercial airplane. The airplane has … | |
What's up guys? I have this question....I'm trying to extract a number from a stream after I extract a charachter but after charachter it displays ASCII value, not the actual number: cin >> ch; num1 = cin.peek(); cin.ignore(80, '\n'); cout << ch << num1; | |
I've been trying to do this asteriks triangle with nested loop for days and many hours and still no luck. Im using visual studio 2010 and I've been searching the web for clues and everytime I use the cout, anything iostream, const char and more it always fails I'm not … | |
Pretty self explanatory code. Why doesn't it work! #include <stdio.h> int main() { __asm__("number dw 0"); // declare number? printf("%d",number); __asm__("mov %eax,number" "inc %eax" "mov number,%eax"); printf("%d",number); return 0; } cc ex1.c -o ex1 ex1.c: In function ‘main’: ex1.c:22:17: error: ‘number’ undeclared (first use in this function) ex1.c:22:17: note: each … | |
Hi Everybody I am trying to create a template class here is the code I trying to just add and multiply 2 number. But I am not able to do so using template class. class calc { public: template <class T> T multiply(T x, T y); T add(T x, T … | |
I am just beginning to learn pointers and I have a question regarding accessing the values using the address. Suppose we have an array of say 10 elements and I begin to access all the elements starting from the 10th element, and go on untill i access the 0th element... … | |
I have a program that is suppose to find the percentage of occupied rooms in the hotel. I have most of my program running, but when I try to typecast my percentage the percentage isn't coming out right and I am not sure as to why. I have set a … | |
hi , i have a 3 columns with content and can be sorted and now i want a small symbol on them when that column is sorted like if column one is sorted then the symbol should be on 1 similarly for rest, And thank you very much for ancient … | |
How would i go about declaring an array that has pointer to linked lists? i need to create an array that has 28 elements(28 letters of the English alphabet) of char type and each of them should be a pointer to a linked list that will store words. i am … | |
Ok I know the difference between delete and delete[] BUT this question just all of a sudden popped in my head since "NOTHING" happens when I use delete[] for all purposes. Now I know when to use one or the other but it still for some odd reason bothers me … | |
How do I set the CMAKE_INCLUDE_PATH? Also... How to I set the CMAKE_LIBRARY_PATH? All i know about CMAKE is that is is a GUI with very limited options. Where do I put these variables and why do I set them? How do I set them? Thanks | |
Ok, so I've recently been learning to code in c++, but I'm getting a little confused on how you read files to functions. For instance, say that I have one file with a list of other files in it. The information within the second set of files (each file) contains … | |
| I'm struggling with C++, especially when it's about sorted list. Do they work like arrays? This is what I'm trying to do: 1. Student applicants will now be stored in a link-based sorted list. 2. Student applicants will be organized into two lists: one for female applicants, and one for … |
i have spent some time trying to install glut in code blocks and so far I haven't succeeded. i have downloaded the glut-3.7.6-bin [URL="http://www.xmission.com/~nate/glut.html"]from here[/URL] . I have looked at tutorials on where to put the files in the download ([URL="http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/#win"]like here[/URL]) but it doesn't work. :icon_question::icon_question::icon_question: | |
I have a function to detect if the mouse is over a mesh but what if I had a hard coded square. I am using D3DXIntersectTri() and pluggin my vertices into it. but they (obviously) dont update when I move the square. My question is how do you get the … | |
I have searched on the internet for a 'working' double to char* does anyone have any idea? I need to pass the string to a function that takes a char* as an argument. | |
HI, I AM THOMAS. I AM IN A COMPUTER PROGRAMMING CLASS AND HAVE BEEN GIVEN AN ASSIGNMENT. I HAVE TRIED TO FIGURE IT OUT FOR A WEEK WITH NO SUCCESS, READ DIFFERENT BOOKS AND VISITED VARIOUS WEBSITES IN VAIN.I HOPE I LANDED THE RIGHT PLATFORM TO HELP ME OUT. THE … | |
how i do this problem, i dont understand this problem plz everyone can help me Write a grading program for a class with the following grading policies: a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, … | |
I am trying to make a program that will check the remaining number of an item left in stock and that will, if someone buys it, subtract the amount of the item bought and then re-write it into the database... (Something like what they use in some stores) How do … |
The End.