58 Topics
I wrote this code that checks whether a number is prime or not. It returns 1 if the number is prime or 0 otherwise. U just look at the bottom of the code... [CODE]#include<stdio.h> #include<conio.h> #include<assert.h> int is_prime(int n); void main(void) { int n=0; clrscr(); printf("An integer "); scanf("%d",&n); assert(n … | |
[QUOTE=Dave Sinkula]You may want to investigate makefiles. Then you can use your favorite editor and still write modular code the correct way.[/QUOTE] I just had a glance at how to write makefiles. Looks messy(will look into that later). So opened Dev C++ instead, and tried to work with projects for … | |
This is (supposed to be) a soln for a [URL=http://acm.uva.es/p/v1/101.html]ACM problem[/URL] But the program produces a runtime error. Can anyone spot the bug? [CODE] #include<iostream> #include<string> #define MAX 25 using namespace std; void print_blocks(); int return_initial(int a);//return all the blocks //on top of block a to their initial pos int … | |
Gaussian elimination is designed to solve systems of linear algebraic equations, [A][X] = [B] This program reads input from a file which is passed as an argument when calling the program. Say the matrix is in file name matrix.txt so we call the program in this way: ------------------------- gauss matrix.txt … | |
Hi there C /C++ experts... I have a confusion regarding the function free(void *) in C and [I]delete[/I] in C++. Suppose there is a pointer named p. In C++, we dynamically allocate memory for p to point at like this [CODE] p = new int [10]. [/CODE],then when we use … | |
i will be given a set of any length and my program will have to produce the power set. For example: input: c d e output: empty c d e cd de ce cde total number of subsets: 2^3 = 8 I will try to write my own code, but … | |
I was trying to do some simple exercises on recursive functions: 1. Write a function using Recursion to print numbers from n to 0. My solution: [CODE]int integer(int n) { if(n>=0) { printf("\n%d",n); integer(--n); } }[/CODE] The next exercise was 2. Write a function using Recursion to print numbers from … | |
i had some experience with 3ds max. But I was so busy for the last 3 months with C++ that now I think i forgot everything. I searched in google for tutorials but there are thousands of them and most importantly disorganised. Now i want to learn fast and only … | |
I was looking for an SDK to learn a bit about fingerprint identification system. I have googled a lot and found many different SDKs. However none of them were free. I dont want to implement any commercial system, just want to work with an SDK for educational purpose. Do you … | |
It's a game where u shoot from a cannon and the cannon-ball moves like a projectile and hits a target. So u will see three major things in this program: 1. Rotating a cannon; 2. How to move an object like a projectile 3. A very simple collision detection Before … | |
I was trying to get familiar with some digital circuit simulation softwares but i dont know which one to start with. I wanted to know if anyone could advise me a digital simulation software that is used by the professionals in the industry. | |
I [B]HAD[/B] three partitions of my hard disk - C, D and E. My OS was Win98se. Then My brother installed Red Hat Linux in the E drive. From then everytime the pc started there were options to choose whether to start with win98se or RedHat linux. I could only … | |
i have this assignment to compute the factorial of an integer of any length. I have done it using array of char and then overloading the * operator accordingly. It works fine but i wanted to know if there were other efficient algorithms for counting factorials of any length. Give … | |
Everyone, have a look at(if u want to) the flash movie in the follwing page: [URL=http://www.newgrounds.com/portal/view/176283]http://www.newgrounds.com/portal/view/176283[/URL] And let me know how u feel... I got some serious issue with this one. | |
I have realized that I should start learning some scripting language from now on. So where do I start? Perl, PHP, asp, javascript etc. I mean which language would be better to start with? | |
I dont get it. There's a guy in this forum who had been helping me out a lot, but i just cant add to his reputation bcos of this message "U have to spread ur reputation point before giving it again to *****" Then I added points to two other's … | |
The following code finds the square root of a number, it runs fine unless you compile with MinGW gcc: [code] #include<stdio.h> #include<stdlib.h> int main(void) { double x0,x1,a; int i; x1 = 1; x0 = 0; printf("\nFind square root of: "); scanf("%lf",&a); for(i = 0; x0 != x1; ++i) { x0 … | |
I am kind of confused about how DestroyWindow() works. According to the help files this function sends a WM_DESTROY message to the window it has just removed from the screen. In my [inlinecode]WindowProc[/inlinecode] I have something like the following: [CODE] case WM_CLOSE: { DestroyWindow(hwnd); return 0; } case WM_DESTROY: { … | |
I am trying to access files in a folder. The folder name and location will be given - the program will search inside the files in that folder for a specific pattern(yup like grep). However, I am not sure how to actually let my program know what are the files … | |
Hi I am into my Database course. I have proposed to develop a criminal record database as the project. If anyone have worked on such a project before or know a few things about it please do share it with me. Currently I am trying to design the schema for … | |
Few days ago I had installed the latest driver for my sound-card (Creative VIBRA 128). From then on my WMP 7.1 is not producing any sound. I can see the videos but there's no sound. But my winamp, DivX player and quicktime are working fine. Then I uninstalled WMP 7.1 … | |
I've recently swithed from borland C++ 5.5 to MinGW. When I try to compile a .c file using gcc it compiles fine, but when I try to compile a .cpp file using gcc it produces a bunch of errors with c++ specific constructs. If I compile .cpp files with g++ … | |
Hello guys, It's about time I get a new computer and I thought it better be a laptop this time. I am looking to buy a laptop which will be just as good as any modern desktop pc with all the functionalities. I dont care much about portability and weights, … | |
I wanted to explore and know about the GUI toolkits available to be used with C or C++. I heard a bit about Qt, GTK, Mingw etc, and there's MFC too. For the moment I am not quite sure which one to start with. Does a programmer need to know … | |
Is there any way I can know which company or organisation is hosting a particular domain name or website. For example: suppose I want to know which organisation is hosting [url]www.daniweb.com[/url] (just an example). How do I find out? | |
This is probably a stupid question, but i dont get the answer. Plz help me understand. Question: How could a linked list and a hash table be combined to allow someone to run through the list from item to item while still maintaining the ability to access an individual element … | |
I have taken permission from one of the sites to use their cool flash intro in my personal weblog. They gave me the permission but the only problem is that after the intro is finished it redirects to a page i dont want it to redirect. Seems like the redirection … | |
Eleven parents in the US state of Pennsylvania are taking their local school board to court in an attempt to protect the teaching of evolution. [URL=http://news.bbc.co.uk/2/hi/americas/4282692.stm]BBC News[/URL] | |
Hey dudes, I need to know the name of this jars. One of my friends told me they are ziraf jars. I did some amazon and ebay searches but couldnt find anything. I need to know the real name and where they can be found. My uncle got an order … | |
[CODE] string s; getline(ifile, s, '\n'); stringstream parser(s); string temp; while(parser>>temp) variables.push_back(temp); getline(ifile, s, '\n'); while(parser>>temp) terminals.push_back(temp);//Doesn't work the second time. [/CODE] stringstream can tokenize the string s only for the first time. The string s is passed to it through the constructor. How can reinitialize the stringstream object? | |
Hi there everyone, Please fill up this questionnaire to help me in my research. It is regarding evolution and religion. I hope to get very good co-operation from you guyz. The questionnaire is [URL=http://www.thesistools.com/webform/index.php?formID=395]Here[/URL] Thank you. | |
Can anyone tell me if there's any standard package for C++ to work with regular expression, or I will have to get some third-party package? | |
I have a template linked list class, eg: [CODE]LinkedList<int> list1; LinkedList<implicant> list_imp;[/CODE] Now I need a Linked List of Linked Lists, This is how I declared [CODE]LinkedList<LinkedList<implicant> > list_of_lists;[/CODE] Then I declared a Linked List of implicant class. [CODE]LinkedList<implicant> implicants_list;[/CODE] I calculated some value and put them in the implicants_list. … | |
I want to make a program that will start off by opening a text file(blank). The user will put an expression in the file and as he hits the enter(enters a newline character) the result will be shown in the next line of the same open file. Itz almost like … | |
I have to write a program where the input is a Boolean Expression and the ouput is the corresponding sum of minterms for that particular expression. My idea is that i need to convert the infix boolean expression to a postfix expression. From there I need to construct the truth-table … | |
After having us write codes to convert decimal numbers to another base my faculty has now asked me to write codes to convert a number from ANY base to another. He explains that itz simple since i already wrote the program to convert integer to another base. So i just … | |
I have written this program to convert a decimal number to a number of any base. The resulting number has been put into an array and so can be of any size. But the decimal number that i take as input is limited by the range of int. What i … | |
I just moved to windows XP and got myself Visual Studio .NET Professional. I just need Visual C++ .NET and nothing else. The installer gives these options and i dont know which components i need and which i dont. 1. Visual C++ Class & Template Libraries ATL MFC Shared Libraries … | |
I want to take integer inputs separated by spaces and terminated by newline character. suppose the user will be inserting integers this way 123 566 789 45 34 8999 341 57 67 and then the user presses enter. so the program will read all the integers when the user presses … | |
I need to add a recursive function, called [B]findaverage()[/B] into BST class that takes as input the root of the BST and returns the average of the entire integer items stored in that BST of integers. Plz help me with this function especially without using any static variables. | |
Hi guyz, I am about to start my third semester in my university. I have options to take Data Structures(CSE 225) or Discrete mathmatics(CSE 173). I am not sure which one take to before the other -- I will be doin both though. What do u guyz think. Will taking … | |
I connect to the internet with the follwing settings: proxy: proxy.sparkbd.net port: 8080 my direct internet connection is very slow but connecting through the proxy server makes the connection a lot faster. Now i have installed limewire and i can connect to the network using "no proxy" but the download … | |
I have a weird situation. Suppose a string will be entered as an input. using the getchar() function i count the number of characters the string contains until a new line character is encountered. So i know the size of the string. And then i try to allocate enough memory … | |
I have to insert a node in a binary search tree. This is what i wrote for the InsertNode() method. But it keeps producing segmentation fault when i run the program. I couldnot find anything wrong in the code. The constructor for TreeNode(int x) sets the item to x, leftchild … | |
I had been using old turbo C++ compiler and with i had the help files on C++. However, the documents with my old version of turbo c++ is quite obsolete now. I want to get the latest docs so that i can look up specific function and class details with … | |
1) How many ways can eight people, denoted A,B,.....,H be seated about the square table shown in the following figure where figure (a) and (b) are considered the same but are distinct from figure (c)? [IMG]http://imagesavers.com/040927/1096305491.gif[/IMG] 2) If two of the eight people, say A and B, do not get … | |
Hi guys, itz my that projectile game in C which used to be in code snippets sections. Well, as u can see no one was able to compile it and as a consequence it's been thrown out of the snippets :rolleyes: Well, here is the complete program, no codes -- … | |
Guys, i m in need of some game sprites. I am trying to make some game using directX. The game is like a space shooter. So i am looking for a nice looking space-fighter with three sprites: one for straight , other two for left and right movement. And i … | |
I can read which key is pressed using getch(). For example i can read whether left arrow is pressed or not. But i want know whether both left arrow and up arrow is pressed at the same time or not-- I want to move an object diagonally across the screen … | |
In my program i will be taking two inputs, lets say two integers. If the number of input is more than two the program will exit. If it is two then the loop will be executed and after that it will again ask for two new inputs-- and will continue … |
The End.