949 Posted Topics

Member Avatar for ks94082817

[QUOTE=ks94082817;1614764]suppose i want to read excel contents of 123 as 'one hundred twenty three'. please provide suggestion. srinivas[/QUOTE] First, you have to know how to read, and what an excel file is. It helps greatly if the excel file is with arm's length of your eyes Second, you need to …

Member Avatar for Adak
-1
107
Member Avatar for newprogramer

Line 39: [CODE]for(int j=0;j<=pos;j++) buffer[j] = '\0';[/CODE] Line 39 and 1/2: ;) [CODE]pos = 0;[/CODE]

Member Avatar for WaltP
0
156
Member Avatar for tubby123
Member Avatar for Adak
0
148
Member Avatar for NewbieinC

A simple game might have pseudo code for a game loop, similar to this: [code] int main(void) { char answer='y' while(answer == 'y') { prompting Do you want to play a game of ... ? [y/n]: scanf("%c", &answer); //get user's answer getchar(); //remove left over newline char from input buffer …

Member Avatar for Adak
0
189
Member Avatar for logicmonster

If you just want to get rid of the newline char, this works great. Put it as the next line after fgets(): [CODE] int len=strlen(char_buffer); if(char_buffer[len-1]=='\n') char_buffer[len-1]='\0'; [/CODE] Your string will look like this after fgets(): my string\n\0 and what this makes the string into is just: my string\0 Because …

Member Avatar for Adak
0
162
Member Avatar for makibao

You should post in the correct forum, and use code tags around your code. Hard to study the code unless you use code tags.

Member Avatar for Adak
0
139
Member Avatar for ineedsomehelp:3

Delete line 8, put lines 4 and 5, where line 8 is now. Right after the scanf() line, add this: [code] getchar(); //new line 5: difficulty = '0'; [/code] And you don't need to assign diff in two places. Just assign it once, just before you return from the difficulty …

Member Avatar for ineedsomehelp:3
0
323
Member Avatar for vincenzorm117

fflush() on any input stream, is undefined. It may work on some compilers and operating systems, but is not standard, and you'd be wise to use fflush() ONLY on output streams, not input streams. Think of it like the plumbing in your house. You can flush the toilet, but flushing …

Member Avatar for Narue
0
203
Member Avatar for NewbieinC

Game programs use a BIG loop to display the menu choices. They have calls to various functions which depend on the user's choice, and they will return to main (and end the program), when the user chooses the quit exit, or end choice. Usually, it's easiest to use a simple …

Member Avatar for Adak
0
132
Member Avatar for ticktoc09

Search Google for ROT13 and you'll have links. Wikipedia is usually good for info on things like this - might go there first, actually. ROT13 is just a simple replacement scheme. Each letter of the text is shifted up by 13 letters. That doesn't work for letter in the top …

Member Avatar for syria718
0
119
Member Avatar for Barnifericus

You did not declare a prototype for your function. Default would be an int, which doesn't match what the compiler sees, when it gets down to the function. Put your function prototypes above main(), with the right data types (the actual names of the variables are not needed), just int, …

Member Avatar for Barnifericus
0
140
Member Avatar for skmajharuddin

C always passes parameters by value (a copy), BUT a copy of an address (like a pointer), is REALLY still an address, isn't it? So there's your copy by reference or address, right there. Remember also, that an array, when being sent as a parameter to a function, will always …

Member Avatar for Adak
-2
82
Member Avatar for Trypanosoma

If by "word file" you mean a text file, just use fopen() with the name of the file (surrounded by double quotes), and the file access mode of "w", and after you've written out your text, fclose(filePointerName), the file. If you mean export your C text file, in Word (the …

Member Avatar for Ancient Dragon
0
688
Member Avatar for Chamath

Visual Express, Code::Blocks, and my current favorite (for Windows only), Pelles C. There is a definite learning curve when you move to any new IDE, but overall, they increase your productivity quite a bit for C, in my experience. I'm shocked that anyone would suggest using a command line (terminal) …

Member Avatar for Chamath
0
157
Member Avatar for murugavadivel

If you have the compressed version, uncompress it (7zip works well and is free from the download.com site and others). Then read and follow the directions in the readme file (I can't recall if it's in TC or TC/BIN, but one or the other). You may need to add TC …

Member Avatar for Salem
0
372
Member Avatar for DarkPyros

Forget your code. Take a pencil and paper, and draw your array of 4 x 4 (or 2 x 2), whatever size you need. Make it simple as you need it to be. Now, look at the paper from above, paper flat on the table or desk. Now slowly turn …

Member Avatar for DarkPyros
0
168
Member Avatar for acnodnem

[QUOTE]575,00 0,0 0,0 0,0 0,0 0,0 0,0 580,00 1,0 0,0 0,0 0,0 0,0 0,0 587,00 2,0 0,0 0,0 0,0 0,0 0,0 633,00 3,0 1,0 0,0 0,0 0,0 0,0 675,00 4,0 2,0 1,0 0,0 0,0 0,0 726,00 5,0 3,0 2,0 1,0 0,0 0,0 801,00 6,0 5,0 3,0 2,0 1,0 0,0 907,00 …

Member Avatar for acnodnem
0
223
Member Avatar for neah

IIRC, you needed to create a new project - to always have a "default project", so the IDE would have one to open. In your borland directory (either TC or TC/BIN), you should have a readme file that has a lot of info on stuff like this.

Member Avatar for Adak
0
29
Member Avatar for jejak

Your program is written in C++, so you're in the wrong forum. An if statement in C looks like: [CODE] if(test statement) { //test statement was true or non-zero printf("\nThat statement was true or non-zero.\n"); } else { //test statement was false or zero printf("\nThat statement resolved to false or …

Member Avatar for Adak
0
665
Member Avatar for alex1050

Your indentation is horrid, of course. I believe your problem is that the scanf(), for a char especially, is troublesome, because scanf() always leaves the newline behind (when the user hits enter a newline is sent to the input buffer, as well as the keystroke he hits). To remove the …

Member Avatar for alex1050
0
107
Member Avatar for sidra 100

In my class (all one of them), the instructor taught us to use the Top Down design method. In a nutshell: 1) Study the problem, better than you believe you need to 2) Put off all the details you can, for now. 3) On paper, note the functional separations you'll …

Member Avatar for Rashakil Fol
0
352
Member Avatar for pril

Muthmuth, it's far better if you: 1) Wait until the poster has made at least one solid attempt to write the code themselves, before you write code for them. 2) Use code tags around your code, ALWAYS. Just highlight your code and click on the [ CODE] icon at the …

Member Avatar for Narue
0
172
Member Avatar for asrockw7

I'm not sure what the Dietal book presented, so let me recommend the bible of C, "The C Programming Language", second edition, by Kernighan and Ritchie. This is the "heart" of C, by two of the developers of it. It's excellent, and definitely "meaty", in a good way. Although none-too-fat, …

Member Avatar for asrockw7
0
427
Member Avatar for manaila

You don't need to post up the whole program, just post up the smallest example of the problem you're having, in a snippet of code that runs and shows the problem. Sometimes, the doctor must actually examine the patient. ;)

Member Avatar for manaila
0
157
Member Avatar for sshejale

Welcome to the forum -- but if you don't show some work toward your query, you won't get help (99% of the time). That's a "rule" in most programming forums, btw. Otherwise, we become a free homework service, while you party on. You see the problem, yes?

Member Avatar for Adak
-2
118
Member Avatar for tubby123

Tubby, Salem is one of the most prolific C repliers on the C forums. What he's talking about is that people post the same info on several boards. Then people like him answer them, ON EACH OF THE SEVERAL BOARDS. That means there's a tremendous amount of duplicated work, especially …

Member Avatar for TrustyTony
0
91
Member Avatar for tubby123

You could have fixed length structs (records), which are normally written out in binary mode, and read in as binary data, using fwrite(). For structs of varying length, (where any member of the struct might have a varying length), the advantages of binary mode just fade away, and they should …

Member Avatar for Narue
0
2K
Member Avatar for celestial_sea

[QUOTE=celestial_sea;1592850]Hello guys! i really need your help. In my program, I am reading the contents of the file. File looks like this: [CODE] 1 ART ACE APE 2 BAT BOY 3 CAT COP CUP CAP CUT [/CODE] I want to store the words in an array. one array per line. …

Member Avatar for Adak
0
146
Member Avatar for BlackJavaBean

Whether you do this in Linux or Windows, the logic is about the same. The page is a perfect representation of a 2D char array. You need to print out a test sheet to discover: 1) What is the top left char that can be printed by the printer 2) …

Member Avatar for Adak
0
142
Member Avatar for tubby123

Good! Now tell me when you know that the word to replace, has ended? 1) a space is reached, obviously ;) 2) an end of line char is reached, of course 3) what about EOF (end of file), and punctuation char's? Lots of details when you deal with strings, language, …

Member Avatar for Adak
0
179
Member Avatar for cesione

[QUOTE]group the numbers in the file into 7[/QUOTE] Into 7 what, seven columns per row, seven rows, seven digits per column, seven digits per row? Show an example: Input, and what you need for your array. Your description leaves a lot to be desired. An example would serve much better.

Member Avatar for Ancient Dragon
0
173
Member Avatar for simply_viks

Using a basic for or while loop, perhaps: [CODE]set i and j to zero while(i is less than 12) { a[j]= index[i++]; b[j] = index[i++]; ... etc. j++; }[/CODE]

Member Avatar for simply_viks
0
96
Member Avatar for tlox

[QUOTE=tlox;1592631]Thank you for your response I was not talking about the windows help system. I mentioned the HTML Help Workshop 1.4 as a software i would like to open the directory with. It is a software used to open/read some e-books. The directory should be static HTML page or application. …

Member Avatar for Adak
0
382
Member Avatar for dharma117

Welcome to the forum, Dharma. :) Two suggestions for your study in C: 1) for technical reasons, C should always have an int return from main. The correct format for main in these programs would be: int main(void) with return 0; at the end of main. I know void is …

Member Avatar for Adak
0
246
Member Avatar for tubby123

I really like the way you're thinking on this! Well done. fgets() is what you want, but you're quite right that fgets() has to go char by char (at a very low and fast level), to find the end of each row of text. It is NOT the same thing …

Member Avatar for Adak
0
95
Member Avatar for dgreene1210

Line 41 - C'mon, you're not ready to open anything yet. You have to get the filename first. Delete this line. Line 44 - You can't use a char array variable, without first declaring it. Declare fName first, then use it. (and don't make it too small). Line 45 - …

Member Avatar for TrustyTony
0
267
Member Avatar for sharathg.satya

It should be obvious by now that this exercise requires SOME type of looping. Recursion is just a different way of looping. Whether the looping works with the program code, (in whatever logic), the operating system, or even the underlying hardware, it makes no difference in terms of the logic. …

Member Avatar for bajishareef
0
274
Member Avatar for jdarrel006

It isn't clear what you want, but what is clear is: 1) You need to learn some basics before you start programming in C. Run through some of the many tutorials that are on-line, or study and practice from a book. 2) Unless you are required to use Turbo C, …

Member Avatar for Adak
0
81
Member Avatar for richa_talwar08

Think about the flow of the program, and work it through with paper and pencil first. Open the file, read the contents line by line with fgets(), until you reach the words to be replaced. All the lines are being written out to a second filename. Acquire the new word …

Member Avatar for Adak
0
448
Member Avatar for campuzcrazyness

When you run a program and the first choice shows nothing, it's safe to say it's lacking! :) I re-worked Choice A, but the answer is being written out in reverse. You need to take the digits and first put them into a small array or LIFO buffer of some …

Member Avatar for campuzcrazyness
-1
549
Member Avatar for gruffy321

Windows has always allowed programs to use the various ports and keyboard input. Can you do it without working through Windows on Win98 SE, -- I'm not sure. If you're thinking about making a keylogger, stop right there. They have a serious risk of being misused - whether it's by …

Member Avatar for gruffy321
0
512
Member Avatar for cse.avinash

I don't have time to work with this right now, but I was wondering if a very short recursive function could help?

Member Avatar for cse.avinash
-1
553
Member Avatar for charchar88

You don't need the Pearl script at all. Do you have the dictionary file yet? Forget the Pearl script, get the dictionary file, and take just copy the first 10 words of so, out, for a test file. Now, what problems do you have?

Member Avatar for TrustyTony
0
374
Member Avatar for adot76

First, use code tags around your program's code. Nobody wants to study code that looks like the dog's dinner, two days ago. ;) Second, narrow it down. WHAT do you need help with? Are you getting the mean calculated OK? Narrow down what we should focus on, and save us …

Member Avatar for abhimanipal
0
984
Member Avatar for mitmehta22

.2 is an output format specification. You are using it in your input format specification for the float.

Member Avatar for abhimanipal
0
7K
Member Avatar for write2diba

Turbo C and Dev C are OK for small exercises, but Dev C is no longer supported (hasn't been for some years now), and Turbo C is 16 bit, which is very limiting for it's data sizes. Also, far pointers in TC are not possible (the memory model is all …

Member Avatar for rubberman
0
2K
Member Avatar for aamira_s

Since the number being tested is an integer, and the actual square root value (the floating point value), is meaningless in this context, using just the int value of sqrt(n) is fine - and smart. However, you are now recalculating this value (the int square root of n), over and …

Member Avatar for Adak
0
166
Member Avatar for cufisa

To show shapes and ALWAYS to post code << Use [Code] tags >> Then the editor will retain ( more of less ;) ), the shape you want, AND the code will be shown in a font that's easy to study code with. Click on the [CODE] icon in the …

Member Avatar for aamira_s
0
161
Member Avatar for benmar

A far better choice: Pelles C - free (only for Windows), but 32 or 64 bit, and unlike Turbo C (which I dearly loved btw), it's up to date, including having it's own support forum. Like Turbo C, it's intuitive to use, and has plenty of help. You'll love it, …

Member Avatar for Adak
0
223
Member Avatar for Ahmed sunny

[QUOTE=venomxxl;1525399]You are using some confusing terminology. If you want to [B]treat[/B] memory as if it was a disk, you might want to look into tmpfs or something like that. Or you could attempt to create your own fs "format". Are you supposed to write a driver? This seems like a …

Member Avatar for Adak
0
2K

The End.