Forum: C May 8th, 2009 |
| Replies: 33 Views: 69,928 I'm pretty sure there isn't much of value which could to added to this thread. Locking it to prevent more shaman interference seems like a sane decision.
For those who have come to this thread via... |
Forum: C Jun 25th, 2007 |
| Replies: 20 Views: 5,157 > However I thought that behavior underfined ment that the compiler
> doesn't know what to do, therefore it would not compile.
You are getting confused between the two of them. Using clrscr() is... |
Forum: C May 10th, 2007 |
| Replies: 6 Views: 1,428 I guess someone here is a big fan of Naure... ;-) |
Forum: C Feb 16th, 2007 |
| Replies: 31 Views: 5,850 A logical formula for score can be something like:
score += 5 * attempts ;
Also for generating good random numbers see this (http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx). |
Forum: C Feb 10th, 2007 |
| Replies: 4 Views: 2,044 Just a minor point, better use ++variable instead of using variable++. If done so prevents the creation of a temporary variable. This is a normal hack used by all programmers.
• Pre-increment(++a)... |
Forum: C Jan 31st, 2007 |
| Replies: 21 Views: 4,187 Actually there are many ways to change value of a character array using a pointer to it...
// Untested !!!
int main( void )
{
int i = 0 ;
// first way -- initialize while declaring
... |
Forum: C Jan 22nd, 2007 |
| Replies: 28 Views: 6,155 Bad, bad really bad. Read this (http://www.gidnetwork.com/b-57.html). |
Forum: C Jan 19th, 2007 |
| Replies: 13 Views: 2,546 Grr....:mrgreen:
But I guess it doesn't matter since I already beat you at the "Hardest Game Ever"....:twisted: |
Forum: C Jan 1st, 2007 |
| Replies: 13 Views: 1,810 Hello there.
Yes, an old compiler imposes a limit on the amount of memory that can be allocated to a single variable, but if that were the senario, the program execution would have halted at the... |
Forum: C Dec 17th, 2006 |
| Replies: 14 Views: 6,560 Hmm...I think there is some typo mistakes in the above one posted by Mr. Dave.
int compareChar(char *myArr, char *mySecArr)
{
int count = 0;
size_t len = strlen(mySecArr);
//... |
Forum: C Sep 29th, 2006 |
| Replies: 10 Views: 2,285 Yeah post your effort here and then maybe we would be able to help you out, just asking for code here would not fetch much help. |
Forum: C Sep 25th, 2006 |
| Replies: 2 Views: 1,032 The thing marked in red in a round brace which should be replced by curly braces.
Hope it helped, bye. |
Forum: C Sep 24th, 2006 |
| Replies: 1 Views: 702 Welcome to the forums and btw it is a rule here that you should first post your attempt or your code to get help from someone else. Just demanding the code will not fetch a lot of help.
Still... |
Forum: C Sep 24th, 2006 |
| Replies: 10 Views: 3,363 There is actually no need to create an array, the problem can be solved using just two "loops". Dont use the function "clrscr()" since it kills program portability and it is a non standard function.... |
Forum: C Sep 22nd, 2006 |
| Replies: 4 Views: 4,656 Better than using scanf which is a pretty complicated function which leaves the input stream dirty try out the alternative functions fgets along with atoi to take the input from user. For the... |
Forum: C Sep 20th, 2006 |
| Replies: 11 Views: 6,715 Maybe something like this is what you are looking for
int main (void)
{
int i, j ;
char num_string[] = "1 234 23 45" ;
char tmp [2] = {'\0', '\0'} ;
int length = strlen... |
Forum: C Sep 18th, 2006 |
| Replies: 4 Views: 4,793 It is not called not writing into the files, as mentioned by me earlier, it is called undefined behaviour when the file stream is kept open.
Undefined behaviour can imply successful write as well... |
Forum: C Sep 18th, 2006 |
| Replies: 4 Views: 4,793 Its normally a rule of the thumb to close the file pointer as soon as you are finished with it to avoid the undefined behaviour of the file stream which you have opened. Even if you dont close the... |
Forum: C Sep 18th, 2006 |
| Replies: 4 Views: 2,045 The first step in solving the problem is to properly understand the problem domain and the prog requirements. IF you just want to accept and manipulate a value for amout of years why not just use... |
Forum: C Sep 18th, 2006 |
| Replies: 3 Views: 1,052 Please seperate your code into logical functions and modules then point out to us which section or logical part is not working as you expected. Giving out such a huge code as Mr. Andor said will not... |
Forum: C Sep 17th, 2006 |
| Replies: 6 Views: 970 If possible please post your code so that we can have a good loook at it and then try to help you in any way possible. |
Forum: C Sep 15th, 2006 |
| Replies: 50 Views: 8,384 Err.. typing mistake maybe, what i wanted to say was:
"For small programming exercises it may not make a difference for you"...
and the you here is the one who thinks writing clumsy code doesnt... |
Forum: C Sep 15th, 2006 |
| Replies: 33 Views: 69,928 Why not try something else which also supports "mouse" as you wanted:
Here is list of some free compilers and IDE which you may find really good and programmer friendly:
... |
Forum: C Sep 14th, 2006 |
| Replies: 3 Views: 1,117 How about starting with this:
http://www.daniweb.com/techtalkforums/thread50370.html
Hope it helped, bye. |
Forum: C Sep 13th, 2006 |
| Replies: 7 Views: 1,517 If you are talking about removing field separators and repacing them with spaces then you can do something like this:
#include <stdio.h>
#include <string.h>
#define LINE_BUF 100
int main()... |
Forum: C Sep 13th, 2006 |
| Replies: 3 Views: 2,868 Yes, i think maybe you are wokring on a 16 bit compiler like Turbo C. Move on to some newcompiler and try your code then. If still error persists post here.
Look for the list of free IDE and... |
Forum: C Sep 12th, 2006 |
| Replies: 7 Views: 1,517 Yes what Mr. WaltP has said pretty much clarifies the situation. If you still need to know some functions which will help you in achieving your task then:
1. Read the current line in a string... |
Forum: C Sep 12th, 2006 |
| Replies: 5 Views: 1,307 When new pointers are created they point to a random location in memory, more like nowhere. It doesnt have to be necessarily an integer variable. Just keep in mind that you cant rely on the value of... |
Forum: C Sep 11th, 2006 |
| Replies: 11 Views: 5,130 Yeah kind of, these people dont even tell me when they are serious and when they are not. Sudden swings from serious thoughts about how to solve the equation to quoting sarcasm are a bit err... hard... |
Forum: C Sep 11th, 2006 |
| Replies: 11 Views: 5,130 What are u exactly trying to prove Mr. Lerner. First you say there is no straightforward way to do it and ask the OP to use an external library. And when the solution is posted you say that even a... |
Forum: C Sep 11th, 2006 |
| Replies: 11 Views: 5,130 The first step in solving the problem is to identify the problem domain properly. Dig out some information on partial fraction decomposition, try to formulate a basic algorithm (the sequence of steps... |
Forum: C Sep 10th, 2006 |
| Replies: 7 Views: 1,481 Congratulations, just keep on putting effort in your work and the rewards will definately come back to you. And if you encounter any other problem just dont hesitate to ask it.
Hope you are... |
Forum: C Sep 9th, 2006 |
| Replies: 5 Views: 1,724 Yes, it actually depends like you said on the type of feat you want to achieve. If you need to access the variable outside the function call you need to make it global.
So if the OP is just using... |
Forum: C Sep 9th, 2006 |
| Replies: 7 Views: 3,552 Hey pooja there are many things in your code worth pointing out to you.
1. Is integrating graphics really a part of your project, coz i think that the project if properly done would look goood... |
Forum: C Sep 9th, 2006 |
| Replies: 5 Views: 1,724 Why not try to make the variable persistent throughout the program by declaring it as global static variable ? Something along the lines given below by me would help you in solving your problem.
... |
Forum: C Sep 8th, 2006 |
| Replies: 8 Views: 1,394 As long as you learn from your mistakes, everyone is happy about it. And btw welcome to the forums. Just be kind enough to respect other ppl out here and i am sure you would get all the help you... |
Forum: C Sep 8th, 2006 |
| Replies: 2 Views: 2,432 In your code i can see that you have used "Tid" without declaring it before.
Also row is a array of char pointers and in your above code you are comparing row [9] with an integer value 0.
Make... |
Forum: C Sep 8th, 2006 |
| Replies: 5 Views: 1,307 Yes what Mr. Hollystyles said is right.
Btw i hope you dont mean to ask something like:
int* a = NULL ;
int* b = NULL ;
// some operation and allocating memory to ptrs. |
Forum: C Sep 7th, 2006 |
| Replies: 6 Views: 1,836 Yes you better follow the guidelines laid down by Wolfpack to solve your problem but while finalizing your code just replace the scanf[/code] with either [inlinecode]getchar () for gettign a... |
Forum: C Sep 7th, 2006 |
| Replies: 3 Views: 1,148 Segmentation error means runtime error which you get when you access the memory location which doesnt belong to you.
A typical case where this kind of error occurs is during array accessing which... |