Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Help needed making C program. (http://www.go4expert.com/forums/help-c-program-t20601/)

naurozbaloch 5Jan2010 15:19

Help needed making C program.
Hi Folks,
I need to make a C program in which ,
1)alphabets are assigned some values. e.g a=1,b=2,c=3,d=65 and so on.
2) computer takes input of a word. e.g the input word is "nauroz" given by user.
3)program prints the numbers which have been assigned to different alphabets and prints the number for word "nauroz".

plzz help needed. I am a newbie.

vignesh1988i 5Jan2010 19:35

Re: Help needed making C program.
pl. expalin the 2nd point properly......... :smug::thinking:

vignesh1988i 5Jan2010 19:36

Re: Help needed making C program.
sorry , pl. explain the 1st point... not 2nd point... :thinking:

naurozbaloch 7Jan2010 13:02

Re: Help needed making C program.
Thanks alot for your contributation . I have solved that problem.but not i want output of that program to be transfered on notepad , i don't know how to do this? could anyone plz help?

Thanks ,
Nauroz Baloch

racergun80 7Jan2010 17:45

Re: Help needed making C program.

Open a file in write mode and with the extension .txt
then write to it.

You'll find lots of examples for writing to the file on the internet.

All the best

Deadly Ghos7 7Jan2010 19:08

Re: Help needed making C program.
do either through cmd redirection using > operator like yourprogram.exe>file.txt or using the file handling concept of c
Code: c

FILE *fp;

fp = fopen("file.txt","ab+");
//this opens file handling mode

Now use various file output functions available in C to write what you want in to the text file.

naurozbaloch 8Jan2010 19:01

Re: Help needed making C program.
what is cmd redirection?
i tried the above code compiler warmed me that fp is assigned a value that is never used?
what to do with this. I am new to programming.
Thanks all for contribution.

venami 9Jan2010 10:12

Re: Help needed making C program.
The above code given by "DeadlyGhos7" tells you how to open a file. But you have to finish the code by referring to other examples of FILE programming in C.

Command redirection will redirect the output of a program(which will be printed on screen) to any other file that we want.

All times are GMT +5.5. The time now is 17:53.