You mean if I use fgets in stead of scanf ?
Type: Posts; User: bchaib
You mean if I use fgets in stead of scanf ?
I think you don't understand my question at all :p
Yes I know and yes I did search for how 2 use fgets, but I didn't gbet anything.
My wone code?
int x = 0;
scanf("%d",&x);
printf("Root of %d is %d",x,sqrt(x));
Yes, but how to use it, pleas? and with wich library ?
Thank you
Hi,
scanf("%d",&x);
How can I control the input ?
if (x is a number) {
//do this
Thank you all for your replies .. I am learling both languages: C and Java :D .. but the pointers in C are making me crazy :cool: :D
I'm doing 2 courses: first course = 120 hours of Java and if I...
@dwks
If I have this :
scanf("%d",&x);
scanf("%d",&x);
scanf("%d",&x);
printf("%d",x);
You said so this means I have to use getChar() three times to see the output !!!?
BUT, suppose I have this program:
#include <stdio.h>
int main(void) {
int x;
scanf("%d",&x);
printf("You entred %d",x);
return 0;
} I muy enter \n 'enter keys' as much as I...
Yesss .. it works .. thank youuu (f) this is much better caus I can't know when or where the program leavs charachters .. !!
Thanks, I get it ..
while(getchar() != '\n') {}
getchar(); Do I really need this for eating the characters left by printf and scanf functions?
:eek: :mad: :rolleyes: :devil: :confused:
I don't understandddd ...
You are talking about the function scanf () which leaves according to you a newline dangling in the input buffer !!!
BUT
Mmm so Getchar() waits for keypress, O.K .. I get it but why do I have to add it ?? why do my program stop if I don't add Getchar() ???
Normally it has to process untill if arrives at }
Yes Dev-C++ :) .. I'm gonne read it but now I have another Q:
#include <stdio.h>
int main(int argc, char *argv[])
{
int a[10];
int i, j, temp;
printf("Give me 10 integers:\n");
I don't understand the differences, I installed Div C++ and I got another code for hello world app:
int main(int argc, char *argv[])
{
printf("Hello World!\n");
printf("Press ENTER to...
Hi,
I'm new in the world of programming, I just begun to program in C langauage.. I started to write my first program using Borland C++ and I can use different styles :
1.
#include <stdio.h>
...
mmm .. combination ... ice + fire gives you water .. :D
@laserlight
Thanks 4 ur advice, I begun today learling programming in C :) printf, scanf and making some variables ..
@matsp
Virus according to me is a program which destroys your files and data or make your computer working slowly ..
Yes now I understand memory management and garbage collection .. in Java we...
@Elysia
Yes, I was reading today in a book about differences between C and Java and I read about pointers in C using stars but there is no pointer in Java.
The Question is: no pointers in Java...
@Perspective
Thank you, .. do you do that ? you are programming on a very low layer if you operate the memory .. you can program virus with C :D
I think it's a lot work to do this memory...
Can you pleas give me an example? but in C we don't have objects !! or not ?
Elysia,
No, I don't want emulators => that's too technical ... I just want in the future to make programs processing...
I don't know that, that is why I ask in this topic.
C/C++ which one efficient, fast and with more possibilities...
Yes, in Java there is applet like this: http://www.physics.uoguelph.ca/applets/Intro_physics/kisalev/java/resist2/index.html
and they are indeed web-oriented but in java you can programm...
Thank you all for your responses, I really appreciate that.
What do you program in C ? database? networking? games, .. ? does it take a lot of time?
Thank you very mucht, I can...
Hello everybody,
I would like to learn how to program a computer and the aim is:
I want in the future to develop a software which can process data and store it into database and also making...