Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c programming 1

Status
Not open for further replies.

varalamahesh

Programmer
Jul 7, 2012
20
exit*(;
should have a prototype?
please provide this...
 
i am doing some mistake's in the programme


"%C" "$c"
here i have a little doubt.....
Data Type Format
Signed char %c
unsigned char %c
is right?
i miss some printing in The book...;!
 
i am doing some mistake's in the programme


"%C" "$c"
here i have a little doubt.....
Data Type Format
Signed char - %c
unsigned char -%c
is right?
i miss some printing in The book...!
 
#include<stdio.h>
#include<conio.h>
#define HLINE for(i=0;i<78;i++) printf("%c",196);

#define VLINE { gotoxy(X,Y); printf("%c",179); }
void main()
{
int i,y,X,Y;
clrscr();
gotoxy(1,12); /*position cursor in row x and column y */
HLINE
for(y=1;y<25;y++)
VLINE(39,y);
}
this programme is Right...?
i feel something Wrong///
Why we defined "X" , "Y"?
look below progrrame ..
#include<stdio.h>
#define AREA(x) (3.14*x*x)
void main()
{
float r1=12.5,r2=4.6,a;
a=AREA(r1);
printf("\nArea of circle is %f",a);
a=AREA(r2);
printf("\nA\rea of cidrcle two is %f",a);
we can't deffined "x".
but we get results...
 
1. Reread your C text-book (C preprocessor, macros).
2. Look at VLINE macros body: there are X and Y variables in generated codes.
3. x is AREA macros parameter name, not a variable name (see #1;).

Please, next time use code tag for your snippets.
 
Function "show" should have a prototype?
give me an example..?
 
>give me an example...
Nobody (except you) knows what's "function show" in unknown code.
(YOU give us an example ;)
It's impossible to write a prototype of unknown function.
 
#include<stdio.h>
void disp(int *);
void main()
{
int i;
int marks[]={556,65,75,56,78,78,90};
for(i=0;i<=6;i++)
disp(&marks);
}
void disp(int *m)
{
show(&m);
}
 
>You are require to write the function show(); on your own. try your hand at it

Are you waiting for anybody who can write the function show with void show(int*) signature?

It's a wrong way to study the C programming language.

See (click) help icon on the reply panel below. Use TGML code tag for your snippets!
 
B.Kernighan & D.Ritchie The C Programming Language.
Wait a bit, the C++ language is too complex for you now.

Read books, write (and run) programs. Don't waste time on forums asking very basic questions.
Your best friends: good books and good compiler (all except your ancient Turbo C;).

Good luck!
 
good compiler>>>
i am using borland c++ compiler
and sys config win XP SP 2,512MB RAM
Microsoft Win XP dos version 5.1.2600
Tell me suitable compilers and also downloading links,,
Thank you Very Much..!
Reading Book:
Let US C-8th edition
written by YASHVANTH KANETKAR
I AM Collecting W.Kernighan & D.Ritchie The C Programming Language.
 
Forget TC/BC clrscr and gotoxy as soon as possible.

Download and install MS Visual C++ 2010 Express Edition.
Regrettably, it does not implement full C Standard (but it has the best C/C++ debugger in the World;). Search Google for download link.

Later look at Ultimate++ TheIDE if you want to study portable GUI programming.
This excellent package works fine with VC++.

Of course, you may use Windows (only;) Forms in VC++ EE for GUI.
 
I've found a good platform for learning C is to take an old PC and download and install Linux. You'll get a full development environment of GNU C, and can move up to C++ when the time is right.

Even if you don't have a spare PC, most Linux distros will now carve a partition out of your Windows installation and set up a multi-boot option.

Ubuntu is a great choice for simplicity. Centos is a good choice if you want to learn RedHat skills (very marketable).

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top