136 Posted Topics
Re: Here are just some "tidy up" suggestions: 1. Your [B]j (of type char)[/B] and [B]ptr[/B] variables are never used. 2. Rather than declaring separate variables to store each character as you read the characters of the input string for each translation, just use one. The same goes for the variables … | |
Re: First of all some housekeeping: 1. In future, when posting code, please use code tags - see this link: [URL="http://www.daniweb.com/forums/thread93280.html"]http://www.daniweb.com/forums/thread93280.html[/URL] 2. [B]void main()[/B] is bad - use either one of the following for the signature of main: - int main() - int main(void) - int main(int argc, char *argv[]) - … | |
Re: You need to use the [B]realloc()[/B] function to allocate additional storage and copy the contents from the previous allocation. You are calling malloc() in your loop which is clobbering memory. You call malloc once and then call realloc whenever you need to allocate additional memory and retain the contents already … | |
Re: [QUOTE=no1zson;942210]This suggestion intrigues me. Putting my main loop inside another loop. I am not sure I understand how to do it, and it sounds almost more complicated than the problems it might potentially avoid, but if anyone can expand on this thought I would appreciate it. Again, my limited experience … | |
Re: [QUOTE=hket89;944382]I forget the question already...hehe^^ Oups, sory...I always use sms language... This is malaysian language, haha!!![/QUOTE] Rubbish! Since when is SMS Malaysian? I'll give you a tip mate, no one likes a smart a**, especially when: 1) they post unformatted code (USE CODE TAGS!) 2) they whine for help 3) … | |
Re: @9868, kimaeasha and abhi.navale Why are you even attempting (and I use that term loosely) to help out yasaswyg? This poster, who is new to these forums (like me) has the audacity to call an extremely astute and knowledgeable poster (Salem) names and still expect assistance. This is my take … | |
Re: [QUOTE=notsogood;942823]Oh sorry, major errors occur at line 89....[/QUOTE] I would advise you to develop this program and get one function working first before moving onto the next function. Trying to write it all in one hit and then resolving all the errors is a laborious chore and an inefficient way … | |
Re: [QUOTE=Dream2code;937759]Hey HI all, Sory for reverting late onto this topic again. Lets look into the chart: e.g [code] ASCII EBCDIC HEX DEC BINARY A * 41 65 0100 0001 [/code] We have an ebcdic file and have onechar *(assumeed) . Now we will convert that to ASCII value. but how … | |
Re: I think you would have to look at the [B]ncurses[/B] library .. or the [B]pdcurses[/B] library for the Window's equivalent to avoid any platform specific requirements. | |
Hello, I've recently finished watching a brilliant five-part documentary online called "The Machine That Changed The World" : a documentary on the history of the computer. It was made in 1992 and was first aired on PBS. It was also aired in Australia (where I live) in the 1990s. I … | |
Re: Yes, I could, but that would be no fun for you. [URL="http://www.daniweb.com/forums/announcement118-2.html"]http://www.daniweb.com/forums/announcement118-2.html[/URL] Show some effort first! | |
Re: [QUOTE=Saschakil;939028]Ask your question in the C forum.[/QUOTE] What? Last time I checked this is the C forum. | |
Re: [QUOTE=taikoprogrammer;939303]Sorry I don't really understand. How would the computer know which numbers are even and odd when going through the array?[/QUOTE] Research and learn about the modulo operator (%). | |
Re: @OP I apologise if this remark seems a little out of place with respect to your query, but I would suggest that you look at using an up-to-date setup. Turbo C is pretty dated. Personally, for the Windows platform, I would recommend the MinGW toolchain in conjunction with your favourite … | |
Re: Please try to phrase your question a little better. From the looks of the signature of your ParseCh function (and the somewhat hazy definition of your function) it appears that you want to parse a string of tokens delimited by the ',' character and return the first and last tokens. … | |
| |
Re: This post is over four and half years old and it was SOLVED. Why are you reviving old threads. And there's that blasted void main again. | |
Re: [QUOTE=tux4life;934263]>[ICODE]string ss="this is an encrytpion program";[/ICODE] Could it be that you meant: [ICODE]char ss[] = "this is an encrytpion program";[/ICODE] here? Otherwise please clarify.[/QUOTE] Besides your correction of the non-existent string type, I can't make any sense of the OP's question? I think (he or she) is "out with the … | |
I'm still relatively new to these forums. I just like to put out a query regarding threads and their solvability. For Daniweb forums, is it considered good practice for OPs to flag threads that they have started as being solved if they have received appropriate posts that have answered their … | |
Re: Well before you even ask a question like that, you need to understand or at least know the difference between OO languages and "procedural" languages. You ask a question with 9 words and expect a answer giving you the full rundown on why c is not considered an OO language … | |
Re: [QUOTE=RobBrown;936073]What input is it waiting for? shouldnt scanf read from the printf line above it. I was using all newBalance before and it was doing the same thing. I am new to this and just generally confused with it sometimes.[/QUOTE] Take John A's advice and just use [B]one[/B] balance variable … | |
Re: [QUOTE=Ancient Dragon;936009]post some of the error messages. Function Search() -- Is [b]state[/b] supposed to be one of the 50 USA states? If yes, then it can not be an integer, but must be 2 character array followed by a null terminator (total of 3 characters). If not, then you need … | |
Re: [QUOTE=edenn1;936149]link to the assignment : [url]http://www.cs.bgu.ac.il/~clang092/wiki.files/assignments/assignment6.pdf[/url][/QUOTE] Here's a link for you: [URL="http://donate_to_my_bank_account.com.au/"]http://donate_to_my_bank_account.com.au/[/URL] Seriously mate, help us to help you. Rather than posting all that code and saying there is a compilation error, how about try telling us what the error is and then perhaps posting a snippet of the code … | |
Re: Your [B]printMonth[/B] function is returning 0 when it's declared as returning void - lose it. Line of code - [B]system("PAUSE")[/B] is not portable. Your range of years is rather odd :-/ If you enter a year outside of your range - besides printing the error message, you also print the … | |
Re: If you haven't noticed, this is the C forum. You should post your question in the C++ forum. Perhaps it's better if you wait for a moderator to move your question for you to the right forum. | |
Re: You have a semi-colon at the end of your [B]for[/B] statement in your code - that will prevent the prompting and gathering of more than one set of data. You declare a variable called [B]custDB[/B] - I think that should be [B]cust[/B]. You're applying the address-of operator (&) for the … | |
Re: [QUOTE=Dave Sinkula;935562]Your pointer is initialized in a screwed-up way. I think you've got bigger fish to fry first. What do you think you're trying to do with your 'bit array' that isn't already done with masks?[/QUOTE] I totally agree with Dave Sinkula's response. Bit masking would be far easier especially … | |
Re: This is a C forum. [B]fflush(stdin)[/B] is BAD. Google it for reasons why. You say "I have a problem", without providing details of what the problem is. Go easy on the TAB key ;-) | |
Re: Show some effort! [URL="http://www.daniweb.com/forums/announcement118-2.html"]http://www.daniweb.com/forums/announcement118-2.html[/URL] | |
Re: I assume you are trying to count the number of lowercase and uppercase letters entered via stdin and load the counts into two separate arrays. You need to load the two arrays within the while loop whilst reading characters in from stdin. I would also change the loop condition to … | |
Re: [QUOTE=anuizath2007;930321]what are the current trends in computer field?i have no idea[/QUOTE] If you haven't noticed, this is a forum on the C programming language. You should post this message in a more appropriate forum and definitely provide more details as the term "computer field" is too broad. | |
Re: > Need help guys! my problem is i cannot store file data into an array of structures. I can already read the file data and also tokenized it so as to separate data. here is content of the file that i am reading: 200001, hamburger, 30.50 100000, cheeseburger, 21.00 > … | |
Re: [QUOTE=rcbhat;929526]I thought that the function parameters were pushed onto stack from right to left. [code=C] #include <stdio.h> main() { int i=0; printf("%d %d\n",scanf(" %d",&i),i); } [/code] But this code prints out the keyboard entered value instead of 0. Why is it so?[/QUOTE] If I enter "42", the output is "1 … | |
Re: NO! .. that's not your problem ... your problem is you're not taking the time to isolate the problem and present it in such a way that people on this forum would be even remotely motivated to even think of helping you! Cheers. | |
Re: [QUOTE=Salem;923170]Don't use [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351"]feof() to control a loop[/URL] Use [ICODE]while ( fgets(buffer,sizeof(buffer),myfile) != NULL )[/ICODE][/QUOTE] Hi Salem, I completely agree with your code snippet for checking EOF as C input functions return values that can be used to test for this condition. However, you could still use the feof() function to … | |
Re: [QUOTE=ichie06;923662]Make A C Program That Performs The Following Algorithm: (a)Use Scan F To Input The Following Data: -assign Value 26 To Age. -assign Value 80 To Weight In Kg. -assign The Value 183.219 To Height Cm. (b)Calculate The Weight-to-height Ratio. (c)Display A Heading For The Results (d)Display The Results In … |
The End.