And why is it used like this?
Type: Posts; User: 7h3_0r4c1_3
And why is it used like this?
#include <stdio.h>
int main()
{
float f=0.0f;
int i;
for(i=0;i<10;i++)
f = f + 0.1f;
if(f == 1.0f)
But why does malloc() return a void of it has malloc(sizeof(int)) inside of it?
Doesn't that belong to the variable it is being assigned to,that is p?
int main()
{
int* p;
p = (int*)malloc(sizeof(int));
*p = 10;
return 0;
}
This is a chunk of code I didn't understand,mainly the (int*),is it some sort of pointer...
Shouldn't the second variable be a character instead of a number?
I read about how you can use the for loop to delay a program's execution,but it's not really portable because the processors might run them differently based on their performance.
C's in built...
I understand,but is there any way of ending the count at zero then?
I was wondering why if I write "start==0" instead of "start>0" the program does not work properly,simply posting the number the user might type?
I intended to make the count stop at zero.
...
I was looking around how to accept input from the keyboard,and I read that certain functions like getchar,gets or scanf are good for small programs to teach you a basic overview on programming,but...
Do you guys know of any good books for beginners wanting to understand the math behind algorithms in an introductory way with explanations on what's going on?
The books I found on algorithms tend...
Do anyone of you guys know of good beginner books that explain in depth every step of programming graphics with SDL for C?
I searched on google, but I could only find for C++.
So after I have read a couple of books on learning the C programming language,what can I do or what should I read in order to get better at programming,gain the suitable mindset of a programmer and...
Now I'm not sure if this is the right section,but I'll post this here.I've got the DevC++ IDE,and I'd like to set up the SDL graphics library with it,but on all the tutorials I saw on the net they...
I want to specify the input to only be an integer instead of a float,char or a string so the program doesn't go berserk when someone does type one of those in.How do I do that?
I'm working with strings now,and I wondered how can you center your strings,and add color to them as well?Also how do you add italics and bold, stuff like that?
I have another problem,and that is after let's say you have three options,and you choose one in which there's a dead end,how do you make it return to the menu,so you can try again,instead of letting...
Thank you.
I was wondering how you can use a time function to delay say a printing of a text with a few seconds?
It's something to do with what system clearscreen does,but I was wondering if you could advise of a better way of doing it.
Thanks guys,I'm interested in one more thing.I saw on certain programs that you can "refresh" the window from the text,in order to show the next available text or options.Can you guys tell me what...
The code is almost what I'm looking for,only with two things missing.
How do you make the program stop to display the results,because getchar() doesn't seem to work,other then system("pause"),and...
Thank you.
Hello, I'm new to this forum and programming in general,but I'd like to learn,and I already started with C programming.
But in a program I'm recently writing I have a problem.It's a small...