949 Posted Topics

Member Avatar for buzzlightyear79

The prototype should be: void toLowerCase(void); If you are receiving other warnings or errors, list them. If it's giving you wrong output, or messing up your input for some reason, show an example. To troubleshoot a program, you have to be active and work at it. P.S. What is the …

Member Avatar for N1GHTS
0
103
Member Avatar for Karasuma

Turbo C has conio.h, which you should include, for gotoxy(), so it's easy to put the text chars, wherever you want it to go. This works fine in Windows XP. (For other Windows user's, it's also easy, just include <windows.h> and use the API SetConsoleCursorPosition().) You have to decide what …

Member Avatar for Karasuma
0
446
Member Avatar for brendono978

I'll be the contrarian, and go with read in pivot number [CODE]if(number <= pivot) { deal with it } else { deal with it }[/CODE] If you want to sort - then sort, but only sort the numbers that should be sorted - so having two arrays (one for not …

Member Avatar for brendono978
0
184
Member Avatar for berwick53
Member Avatar for jemz

[QUOTE=jemz;1361967]Hello can you help me please... im making the program that will display the smallest number using function in array...please help me...thank you in advance...hoping for your positive responds.... [CODE] #include<stdio.h> void accept(); //should be void accept(void); void findsmallest(int num[],int size); //well done! int a; //should be removed int main(void) …

Member Avatar for jemz
0
122
Member Avatar for WANTONOMORE

What i like to have, is a menu function where I can choose to: 1) display one record I've searched for 2) edit a record I've searched for 3) display a group of records - say video's with titles beginning with the letter A,etc. Pausing between screens. 4) display all …

Member Avatar for Adak
0
119
Member Avatar for moye88

Instead of assigning the Max value to 0 (which might fail if you were measuring Arctic temps in the Winter), assign Max to the first temp in your data. If a higher temp is found, then Max should be set to that higher temp, of course. If a higher temp …

Member Avatar for moye88
0
154
Member Avatar for j.shakthiyokesh

The program is using the last row's minimum, instead of the current row's minimum: [CODE] Original data: 999 54 48 92 24 54 999 32 61 35 but i'm getting output as....... 975 30 24 68 0 >> 30 975 8 37 11 Minimum here should be 32, but your …

Member Avatar for mfaisalm
-2
207
Member Avatar for abhii

Look in the "number puzzle" thread. My last post has a very simple sort in it. (near the bottom of the program). @AD: What forum are we in -- std::sort ?? ;)

Member Avatar for Ancient Dragon
0
262
Member Avatar for swapnaoe

Picture how it works: 1) The pre processor substitutes the numbersUL, for the expression SECS IN YEAR. 2) Now the compiler comes along and see's the number, but what data type (size) should it be given? General default is integer, which is not big enough on a 16 bit machine. …

Member Avatar for Adak
0
190
Member Avatar for stevanity

Sorry. Prim's algo is beyond me. That program doesn't look too difficult to follow through in a debugger, step by step. Good luck. ;)

Member Avatar for Adak
0
689
Member Avatar for DrueY

[url]http://en.wikipedia.org/wiki/Fast_Fourier_transform[/url] Way too big a topic to be covered in a post. Enjoy! ;)

Member Avatar for Adak
0
120
Member Avatar for myk45

That's a great way to do it, (called "Counting Sort", sometimes), IF the range of the numbers, is not too large. Run time is O(n), and you can't beat that, as long as the range is suitable.

Member Avatar for myk45
0
102
Member Avatar for Goshutu

That's C++, not C, so I can't help you. Obviously, you're not allocating the memory you need. When you can put in ten int's or so before the program crashes - that's an allocation that never worked. You should be able to test and see if the call to allocate …

Member Avatar for Goshutu
0
449
Member Avatar for halil.burak

You want to draw something round? Round off a number? You need to be specific, and give an example of what you want. If you have some code for this, post it up! Tell us what has you stumped. A 13 word request for help, doesn't show that you're actively …

Member Avatar for halil.burak
0
135
Member Avatar for gaurav_13191

Trying to debug that program is not simple - he has set in his logic using very specific values including "magic" numbers. His book doesn't show a diagram of what the circle should look like? Weird! When I ran it, I also got an ugly red square with barely rounded …

Member Avatar for Adak
0
133
Member Avatar for diddle

Welcome to the forum, Priva.t! ;) A few very solid suggestions for you: 1) For your problems, unless it's EXACTLY the same, always start a new thread 2) You have to be VERY specific about what you are asking about. "Draw nonlinear objects", doesn't tell anyone what you are stumped …

Member Avatar for Ancient Dragon
0
364
Member Avatar for dragonpunch

Your strings have no deep portions to them, so I'm confused. A deep part would be an array of pointers, where each pointer might point to a string, someplace else in memory. You see deep structures commonly. The struct has a char * as one of the struct members. Did …

Member Avatar for Narue
0
409
Member Avatar for manalibhadula

When you merged the arrays, you used pointers or indeces (int's usually), to help you do the merge. Now, you can use that pointer or index, to temporarily hold (or point to) a value - now any of several in-place sorters will do what you want.

Member Avatar for Unimportant
0
157
Member Avatar for srinivasan106

The first sort you listed is one I use as an "Easy" sorter. It's like a bubble sort, but simpler to remember and quicker to keyboard also. Performance is similar to, but slightly faster than, bubble sort. You can tell it's NOT bubble sort, because bubble sort compares only adjacent …

Member Avatar for localinternet
0
326
Member Avatar for simmyhp

I use a "step" kind of logic. Each check function returns either 1 (checked ok, or 0, check failed) [CODE]if(checkRow(row, col)) { if(checkCol(row, col)) { //only if row checks out OK, check the col if(checkBox(row, col)) { //only if row and col check out OK, check box number is OK …

Member Avatar for Adak
0
605
Member Avatar for SanJuanWolf

Think of it like three wheels on an old fashioned car odometer. Each wheel is from a different group, and each wheel can spin around, and then go back to it's starting value. Three nested for loops is the simplest implementation I know. Arrays are what I use, for each …

Member Avatar for Airshow
0
221
Member Avatar for berwick53

You'll need a variable to count the loops, and then another for the upper limit: for(i=0;i<UpperLimit;i++) In this case, Upper limit equals both the longest number of char's in the last row of the pyramid, but also, the number of rows to be printed. Convenient. ;) How about a 'j' …

Member Avatar for Schol-R-LEA
0
127
Member Avatar for gaurav_13191

You are clearing the screen, immediately AFTER you call the function! Try clearing the screen BEFORE you call the function! ROFL! ;)

Member Avatar for gaurav_13191
0
108
Member Avatar for Rahul.menon

Selection sort does NOT compare every element, with every other element, every time through the loop - you misunderstood the algorithm. Selection sort is always a step better than bubble sort, in my tests on both random and real life data. Bubble sort and Gnome sort, are the slowest non-joke …

Member Avatar for Rahul.menon
0
94
Member Avatar for TheBaby7591

HELP??? [code=c] #include <stdio.h> #include <math.h> #include <string.h> int main() { FILE *inputfile, *infile; double mark; int grade; ??? int avg = 0.0; int i = 0; char student[30]; char filename[30]; char *first, *last, *middle; printf ("Enter Name of Data File: \n"); scanf ("%s", filename); inputfile = fopen( filename , …

Member Avatar for TheBaby7591
0
114
Member Avatar for keichi19

Please stop posting other people's code! You were given these assignments so you could learn BY DOING them, how to program in C. Practice the exercise of your own logic, and learn C syntax and get an introduction to troubleshooting. All of these skills are essential for a C programmer. …

Member Avatar for keichi19
-3
713
Member Avatar for yesamin

That depends what data structure you made the stack with. For a linked list, you simply add the extra nodes you want, in a for loop, perhaps. For an array being used as a stack, you would include <stdlib.h> and realloc() more space. Array resizing should be done rarely, and …

Member Avatar for Adak
0
61
Member Avatar for rizrash

How about a little calculator? Go to Wikipedia, and read up on RPN (Reverse Polish Notation), or Tower of Hanoi, or a game of Blackjack, or Battleship or a simple encryption/decryption program, or Conways Game of Life? Whatever you choose, make it something that personally interests you. The guy who …

Member Avatar for Adak
0
2K
Member Avatar for hoganmadman

In a previous version, i may have equaled the count of the numbers entered, but not now. Now you want i=0;i<count;i++ and %d, array[i] for the for and print statements, respectively. Technically, the top for statement should be "this < count-1". Why? Because next is always one element higher than …

Member Avatar for Adak
0
130
Member Avatar for Hitman Mania

Please forget about the previous problem and the code that solved it - it puts the focus on something that is not the NOW problem. That's what to focus on. As you stated the problem, the answer is there is a HUGE number of n, that can't be exactly equaled …

Member Avatar for Adak
0
170
Member Avatar for mi.mac.rules

Dude, if you want help on the forum, then post your code on the forum. I went to your link and all I could do was get advertising and crap. Your file is apparently there, but you can't d/l it. Get real if you want help.

Member Avatar for mi.mac.rules
0
2K
Member Avatar for hoganmadman
Member Avatar for aiki985

May I suggest something more do-able? This just seems WAY over your programming level. Nevertheless - strtok() is the function most commonly used to "burst" words into a 2D char array, word by word. I can't say this is anything but rough code, but this will burst up to 120 …

Member Avatar for aiki985
0
229
Member Avatar for USC_Megoy

I would have guessed that "things don't work in a proper way". Way too vague, however. :( First, post your code with CODE TAGS around it, so it doesn't look like what the dog threw up last week, and second, post the errors - the SPECIFIC ERRORS, that you are …

Member Avatar for Ancient Dragon
0
222
Member Avatar for arnas

Because you have it set to return Boolean values (0 or 1), you can use a construct like this: [code=C] if(is_prime(number)) printf("\n%d is prime", number); else printf("\n%d is not a prime number", number); if(is_prime(number)) printf("\n%d is prime", number); else printf("\n%d is not a prime number", number); The return from a …

Member Avatar for Adak
0
166
Member Avatar for srinivasan106

Multiple column sorting sounds like multi-key sorting, where the column totals, are the keys. This is something YOU must verify. Only you know the instructor who gave you the assignment, and have the class notes, contacts, etc. Sounds like each key is ranked by it's priority, same as always. Please …

Member Avatar for Ancient Dragon
0
82
Member Avatar for Ajith007

Just checked, and there's a TON of sites on this topic, on Google. No code here, but this applet shows the actual "inner workings". Once you read up on it pretty good, go here and see the bits fly: [url]http://www.ecs.umass.edu/ece/koren/arith/simulator/Booth/[/url]

Member Avatar for Adak
0
297
Member Avatar for TheBaby7591

guess and tries should be int's - you'll never have .23 of either! ;) Try adding a lo, mid, and hi variable. Then, when the guess is too high, bring down the hi variable to your current guess-1. When your guess is too low, bring up your lo to your …

Member Avatar for TheBaby7591
0
115
Member Avatar for Caeon

Your input stream is still holding the newline char. Remove it by adding this: (void) getchar(); After each time you're looking for a char input (getchar or scanf(%c)). fflush(stdin) is non-standard, and generally doesn't work, because stdin is an input stream, not an output stream. And [B]Welcome to the forum, …

Member Avatar for Adak
0
91
Member Avatar for smize33

I use Turbo C/C++ a LOT, and it supports //comments, with either the C or C++ compiler. My version is 1.01 Your install may have become corrupted. Look for the Turbo C/C++ version, NOT the Turbo C version (which was earlier, and had significant bugs). Turbo C/C++ 1.01 is good, …

Member Avatar for N1GHTS
-2
189
Member Avatar for CodeAerial

I believe you're making it hard for yourself. Just: 1) Sort the data points for each row in the 2D array. 2) Print the stem, the | and the columns of data from that stems row of the array. And you're done. Don't use Rube Goldberg logic - simplicity leads …

Member Avatar for CodeAerial
0
977
Member Avatar for konohastar

In this code: [CODE] void DollarsToYen ( float Dollars[], float Yen[], int count ) { int j; for (; j < count; j++) Yen = Dollars * DOLLARS_TO_YEN; printf("","The conversion of $ to y is %10.2f\n",Yen); } [/CODE] Dollars is an array, and you shouldn't be trying to multiply that …

Member Avatar for konohastar
0
118
Member Avatar for wildberries

Include string.h header file, and use strstr() to check each line of text, in the char array "line". For each line, you may need to have two checks, one for each word, depending on the specifics of your search. If the words are found, print the line array. Note that …

Member Avatar for WaltP
0
139
Member Avatar for hisugan

I'm not sure if you want to separate numbers FROM letters, or numbers AND letters, but: if FROM: Numbers have lower ascii values than any letter, so any char less than 'A' can't be a letter. if AND: Remember that a pointer or index can "walk" a string array, or …

Member Avatar for konohastar
0
151
Member Avatar for advait_123

The simplest way to avoid this, on this forum, is to stay AWAY from "NIGHTS". He's a pointer fan, big time! ;) Seriously, use indeces (aka indexes), instead of pointers. Let C handle the change from index to pointer value. Are you trying to add up the whole array?

Member Avatar for N1GHTS
0
103
Member Avatar for eman 22
Member Avatar for prasanthsagar

Algoritmus, your code is OK. Understand that Ancient Dragon is being technically correct and please don't: 1) Get upset. Get comfortable in your skin, and "thicken" it. Don't feel threatened by a critique of your code or pseudo code. That's what we do here! 2) Please stop making excuses. "It's …

Member Avatar for N1GHTS
0
313
Member Avatar for mmmm1118

You haven't given enough info to answer that question - there are many different ways to make a database. For the simplest - a "flat file", you have one or more data files, that are accessed by your program, as needed. If the amount of data is quite small, it …

Member Avatar for N1GHTS
0
191
Member Avatar for reddishmiles

1) check that the customer has given you an amount exceeding his bill 2) use this equation: amount given - bill equals change due back to the customer imo the easy way to deal with money is to multiply it all by 100, in order to eliminate any amount less …

Member Avatar for reddishmiles
0
969

The End.