- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 6
- Posts with Upvotes
- 4
- Upvoting Members
- 5
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
- Interests
- Gaming, Programming and Motorsports
37 Posted Topics
This program displays a simple analog clock to show the current system time. Uses a Hand class to create objects - hour, minute and seconds hands.The 'hands' are just straight lines, and two circles make the 'frame' of the clock. Compiles correctly on TurboC++ v3.0 | |
This program solves the geometric problem, called the Convex Hull problem. Given a set of points, the objective is to find a region such that the line joining any two points lies within that region. Informally, it is the polygon of largest area that can be formed out of the … | |
This program calculates the determinant of a square matrix of any order using a recursive function. Uses a square matrix struct and related functions. | |
This program outputs a given string word-wrapped to N columns in console. The program can also handle words whose length is greater than N. | |
A very versatile, fully customizable graph drawing program using the TurboC++ graphics library. The DrawGraph() functions does the actual graph drawing. It can be used to draw graphs of BOTH CARTESIAN AS WELL AS POLAR functions. You'll need to pass the math. function to the program. The main() demonstrates the … | |
Program to demonstrate pattern-searching of strings. This program interactively builds a list of words and searches for words in the list that match a specified pattern. The pattern can include wildcard chars * and ?. Eg : The query s* gives the words in the list which start with s. … | |
Hey People! This program gives you all Pythagorean triplets in a given range.( Eg. ( 3,4,5) - 3^2+4^2 = 5^2 ). I've used a pointer to allocate memory to hold the squares of all numbers in the range. The program uses a function to search for element in the array. | |
This program prints the prime factors of a number. Eg. 56=2x2x2x7 .I've heard its really important and stuff.I believe it is really efficient and simple. Uses two functions : one to check if a number is prime and other to return the next prime number. | |
Re: Its hard to answer without details of the environment/IDE/compiler you are using. I am guessing your are using a DOS mode IDE like Turbo C/C++. If it is so your program will run in the DOS (16-bit) environment of Windows and it cannot interact with the rest of the applications … | |
Re: Try [code] fscanf(cfptr1, "%f", &a[i][j]); [/code] instead of [code] fscanf(cfptr1, "%5f", &a[i][j]); [/code] It doesn't make much sense to use format specifiers in your case anyway. Some general observations regarding the code: NEVER use magic numbers like this in your code: [CODE]for (i=0; i<16; i++) { for (j=0; j<190; j++) … | |
Re: Well, this question has more to do with regular expressions than Java... Anyways I'll try to define what the Regex "J.*\\d[0-35-9]-\\d\\d-\\d\\d" means. .* will match any number of any characters, \\d matches any digit, so the expression will match any string that has a [LIST] [*]J followed by anything (matched … | |
Re: In You are passing tempdate by value to incrementdate. So the statement [ICODE] tempdate = temp_dat;[/ICODE] makes no effect to the tempdate variable of main. So tempdate of main still contain the original string "27-12-2000" You have two options to rectify this: 1. Pass tempdate by reference: Either [ICODE]char* incrementdate(int … | |
Re: const int WORD_LEN = 3; for(int q=0;q<r;q++) { for(int p=0;p<c;p++) { | |
Re: If you look at the way in which the objects are laid out in memory, BASE and DERIVED pointers to the [B]same[/B] DERIVED object have the same address (unless there is multiple inheritance involved). So you can access your BASE object from the DERIVED pointer. If you can do [CODE]trysomething() … | |
Hi, I need a control my native application written in C++ that provides a functionality similar to the SplitContainer control of .NET (System.Window.Forms.SplitContainer). I couldn't find any native control that does the job. Can I get such control or do I have to write it myself? Thanks in advance | |
Re: Multiplication, division and modulus operations on powers of 2 can be made much faster using bitwise operators. 1. Modulo Finding the modulus is particularly expensive. This operation can be performed mush faster using the & operator, because [inlinecode]a % n == a & (n-1)[/inlinecode] where n is power of 2. … | |
Hi, Please let me know if this post doesn't belong here... I couldn't find a dedicated forum for network programming, so posted this here. [INDENT]I'm developing a client and server for using Winsock/TCP/C++. I'm relatively new to network programming and have a few doubts :[/INDENT] [LIST=1] [*]Suppose I send 8 … | |
Hi everyone, I need to be able to run a Java application (not an applet) directly, that is not from an IDE or the command line. How can this be done for a Windows PC? I have seen many applications written in Java, but are executed just like other Windows … | |
I have two static libraries: [INDENT][COLOR="Green"]/usr/X11R6/lib/libX11.a[/COLOR] - Standard library, ~ 1.5MB [COLOR="Green"]./libxbgi.a[/COLOR] - Created by me, ~60KB[/INDENT] Now I use the following commands to compile a program, [I]test.c[/I]: [inlinecode]$gcc -o test test.c -lm -L /usr/X11R6/lib -lX11 -L . -lxbgi[/inlinecode] This works fine, the executable [I]test[/I] is 33KB, which is as … | |
Hi... I have a static library, libxbgi.a. When I want to properly link a program with this library I have to write: [INLINECODE]gcc prog.c -o prog -lm -L /usr/X11R6/lib -lX11 -L. -lxbgi[/INLINECODE] It is cumbersome to write such a long command line. Is it possible to pre-link the libX11.a and … | |
Re: You have to write two more functions to compute the total marks and the highest marks. I can suggest the prototypes as: [CODE]void totalmarks( int ¤tTotal, int &marks ); void highestmarks( int ¤tHighest, int marks );[/CODE] Its really simple to implement these functions. Hope that helps. | |
Hi everyone... I need to build a file browser for a wireless multimedia device for a Windows PC. The objective is to be able to browse contents of the device. The device defines its own protocols for communication. I have divided the whole project into two modules: the browser and … | |
Re: [QUOTE=JadedTortoise;330826]OK I am wondering Can you make a variable hold an operator. Such as say +, -, / etc... And if so can that variable be used to replace an operator in an equation? for instance char a = "+"; int b = (2 a 3); thoguh that doesn't work … | |
Check this code: [code=c] float velocity, acc, time; . . velocity = velocity - acc * time if( velocity == 0.0 ) { // Do something } else { // Do something else } [/code] This code isn't always workng. When the velocity is supposed to be exact 0, it … | |
Re: If you are going to erase and redraw without sufficient time interval in between, it will cause blinking which is visible. You don't need to draw anything until the position of the second hand changes, i.e. after each second. Whenever you cange the position of ANY hand , erase and … | |
I want to read a file which contains a list of integers. The first 4 bytes( or whatever sizeof(int) is ) indicates how many numbers the file has. Suppose I check the file size before reading so that I know I won't encounter EOF. Do I still need to check … | |
Can you write a program that prints its own source code ( in C/C++ )? Of course it would be easy to do that referring to the source file, but how can this program be written assuming that the souce file is not available at run time? :?: :?: | |
Re: There is a better way to do it: [code] char buffer[30]; sprintf( buffer, "i = %d", num ); outtextxy( x, y, buffer ); [/code] This is a more general solution. | |
Re: No you can't... When you declare [code]void (*fptr)(const void* , const void*);[/code] it explicitly means that the function pointer can point only to the functions which take two pointers as arguments and return nothing. Hence, you can only pass f1 as an argument. You probably have to declare fptr as … | |
While calling a member function from within another member function, isn't it better to write [COLOR="Red"]this->member_fun( )[/COLOR] rather than [COLOR="Red"]member_fun( )[/COLOR] ? That would make it very clear that we are calling a member function. What is the coding standard here? And what could be wrong with the first version? | |
Hi... I am trying to write a string class...this part is supposed to concatenate two strings, but I am having trouble with constructors/destructors.:rolleyes: Please explain the exact sequence of calls and the correct way to code.:?: [code] #include <iostream> #include <cstring> #include <conio.h> using namespace std; class STRING { char … | |
Hi all, what exactly is segmentation fault or access violation and exactly when does it occur? Why does the following program work correctly : [code] #include <stdio.h> #include <conio.h> int main( ) { int a[5]; a[20] = 20; a[-20] = 30; printf("%d %d", a[20], a[-20] ); getch( ); return 0; … | |
Hi, I want to write a function that coverts a double number into its rational form. For example if the input number in 4.33 I must get numerator = 433 and denominator = 100. Here is something I tried, it doesn't work because of floating point inaccuracy : [code] void … | |
Hi, this program is supposed to print the first word of a string ( the whole string could be a single word as well. But it gets stuck in an infinite loop :!: : [code] #include <stdio.h> #include <conio.h> int main() { char *str = "This is a sample string"; … | |
I came across this problem in one of my test papers. It says : Write a program that deletes itself( the exe file ) when run. Here's my first attempt and it didn't work, so I added the error-checking code. [code] /* This program tries to delete itself */ #include … | |
This is really simple code that prints the address of a variable : [code]int main() { int x; scanf("%d", &x ); printf("Address of x : %X, value : %d" ); return 0; }[/code]<< moderator edit: added [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code][inlinecode][co[u][/u]de][/co[u][/u]de][/inlinecode][/url] tags >> Simple as that. But the thing is this program gives the … |
The End.