- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 18
- Posts with Upvotes
- 17
- Upvoting Members
- 10
- Downvotes Received
- 6
- Posts with Downvotes
- 6
- Downvoting Members
- 5
Re: [QUOTE=shubhamgore;1231564] why should we have to avoid goto, i have used it here becoz i have learn it yesterday from complete reference (c) [fundamental book for c language], and there was a note, saying that whenever we want to shift control of program over any part of the code, [U]we … | |
Re: Yes, you can simplify this code - I would suggest to dismiss branching statements in "decode" procedure and make use of static array of LED patterns. Something like: #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAKE_PATTERN(b1, b2, b3, b4, b5) ((b1 << 4) | (b2<<3) | (b3<<2) | (b4<<1) | … | |
Re: As unofficial rule - all C/C++ macros are written in all caps. Underscores simply helps to improve readability if constant consists from several words. It's possible to name a variable with underscores, but it's uncommon. So if you see all caps symbol with underscores in it - you can be … | |
Re: [QUOTE=akki30;1285547]how this function is used. i m so confused n not getting the proper result[/QUOTE] Fibonacci number is calculated in pretty straightfoward way: [IMG]http://upload.wikimedia.org/math/0/c/e/0cebc512d9a3ac497eda6f10203f792e.png[/IMG] No additional comments needed... | |
Re: [QUOTE=mohan_198505;787487]4.Login name and password are hardcoded in the program and not strored in any file.[/QUOTE] I find this self-contradictory. "Hardcoded" means that password WILL BE stored in program file as embedded string resource. So for added security i suggest to hardcode not plain password, but instead MD5 hash of password. … | |
Re: Or... use backtracking algorithm => [url]http://en.wikipedia.org/wiki/Backtracking[/url] Main idea- Save each crossroad decision you take in the tuple form [ICODE](COL, ROW, DIRECTION)[/ICODE]. Such as after N iteratiions you will get list something like: [ICODE][(1,2,UP),(4,5,DOWN),(6,8,LEFT),(10,14,RIGHT),...][/ICODE]. Fill this list until you get into blind alley OR no NEW crossroads are reachable. If so … | |
Re: [QUOTE=pretu;380468]HI All How can we generate a sine wave without using the sin() function. Thanks pretu[/QUOTE] You can try Taylor series also. | |
Re: [QUOTE=fallopiano;1464979]Hey everyone, as the title suggests I'm trying to find a function or some code that'll execute a string of code in Lua. [/QUOTE] [URL="http://www.lua.org/manual/5.1/manual.html#pdf-loadstring"]LoadString()[/URL] | |
Re: In your [ICODE]while(1)[/ICODE] loop put alarm condition check, if it passes - write something to alarm port. Here is some code for PIC16F84A. [url]http://www.micro-examples.com/public/microex-navig/doc/084-alarm-clock[/url] It's mikroBasic, not C code, but I think you will get the idea. | |
Re: Also i want to say that this question is related to compiler design. So i would suggest to learn compiler design/programming in general, before advancing to concrete problem. | |
Re: You can always try random walk algorithm: [QUOTE] While (PUZZLE_NOT_SOLVED) { tiles = 4 tiles around hole; tile = RANDOM_TILE_FROM(tiles); MOVE_TILE(tile); } [/QUOTE] This algorithm is very inefficient and not ensures that solution will be found. And it is just pseudocode. But hey, you are supposed to do homeworks yourself. … | |
Re: [QUOTE=gauthamnaggg;473435]Hello all, I need to write a code that compress and uncompresses thegiven file in c.Well i know there are many algorithms available ,one of the famous algorithms is Huffman's algorithm.But how do i implement the algorithm ?.I googled a lot but couldn't able to find ?.Is there any simple … | |
What language is the most difficult to compile and why ? (except natural ones) | |
| Re: [ICODE]write_data(...)[/ICODE] is callback function which will be called every time each new data portion arrives from internet. So basically you should measure download speed and remaining time in your function write_data(): 1. save current time in local variable time1 2. then download speed will be [ICODE]written/(time1-time2)[/ICODE] 3. save current time … |
Re: Since you didn't write a language in which you want to program - for the beginner i would recommend either [URL="http://love2d.org/"]Lua + Love2D[/URL] OR [URL="http://www.pyglet.org/"]Python + PyGlet[/URL] Happy coding! | |
Re: And a bit shorter version ;) [CODE=C]((a>b&&a>c)?a:((b>c)?b:c))[/CODE] | |
Re: [QUOTE=anu john;416424]Ye. it will be a kit with ethernet chip n rj45 connections.therefor the tcp/ip protocols needed will be taken care of.. nw i need to program my controller using c language in a way that i can access my sql server 2005 on a remote machine...Also im trying to … | |
Re: [QUOTE=pato wlmc;1260648]Well, right now i'm using linux, but i've heard that windows is really best for programing videogames ( on c++ ) well, wich O.S. do you think is the best? P.D. Sorry for the bad english jeje :$[/QUOTE] When it comes to game development definitely answer is Windows. Simply … | |
Re: I don't think that SQL server (or any other database server) is suited for multiplayer purposes. Usually game devs for multiplayer mode writes it's own server and client. So I would recommend to you to write TCP/UDP server and client by using System.NET library. Check this out- [url]http://www.codeproject.com/KB/IP/socketsincsharp.aspx[/url] | |
Re: From the problem description is not clear - Do you want just move 3D model in space or animate different pose ? Ok, I make assumption that you want to animate pose, because you mention different body parts. How to do that just google keywords "mesh deformation" and/or "skinning GPU". … | |
Re: Indeed CUDA is only for nVidia cards. I suggest better using OpenCL. Also if these calculations is only for computing image transformations- you can try Pixel Shader. | |
Re: [QUOTE=sourabhtripathi;1216213] now can i achieve increment in both value and pointer in one line ?[/QUOTE] It's pretty straightforward - [CODE] // increments pointer and then value ++(*(++p)); // increments value and then pointer ++(*(p++)); [/CODE] | |
Re: A VERY interesting question ! Thanks for asking such thing :) Both methods are polyalphabetic ciphers. There are some algorithms for polyalphabetic ciphers which computes key size from ciphertext. Once key size is known, ciphertext can be splitted into columns which are vulnerable to simple [URL="http://en.wikipedia.org/wiki/Frequency_analysis"]frequency analysis[/URL]. So answer is … | |
Re: Wiki is our friend: [url]http://en.wikipedia.org/wiki/Maximum_subarray_problem[/url] Kadane's algorithm performs in O(n) for 1D array. | |
Re: [url]http://www.computeruser.com/articles/xp-professional-vs.-2000-professional.html[/url] | |
Re: [CODE=C] #include <stdlib.h> // on windows clear screen with system("cls"); // on unix/linux clear screen system("clear"); [/CODE] | |
Re: I made some fixes, here corrected version: [CODE=C] #include<stdio.h> #include <stdlib.h> void getOption(); void getData(int *num1, int *num2); void calc(int option, int num1, int num2); float add(int num1, int num2); float sub(int num1, int num2); float mul(int num1, int num2); float divm(int num1, int num2); void printResult(float result); void clrscr() … | |
Re: [QUOTE=AuburnMathTutor;1257975] I pointed out that we started with a language that was much farther from natural languages, i.e. machine language, and have since developed languages that are more similar in structure to English. [/QUOTE] Seems you are over-fitting your observations of programming language evolution of C-like languages. Take a look … | |
Re: [QUOTE=GameGuy;1212348] How long, if I have no experience, until I am making 3D FPS'? [/QUOTE] My advice - don't start with FPS project. It's the problem which faces beginners of game programming. If you want to learn 3D game programming - at first choose very basic 3D project - such … | |