num=(rand()%3) == 2 ? 2.0 : (rand()%2) + (float)(rand()%1000000)/1000000;
Type: Posts; User: cs05pp2
num=(rand()%3) == 2 ? 2.0 : (rand()%2) + (float)(rand()%1000000)/1000000;
I want to get random float numbers from 0 to 2 (included). How do I do this?
Why is not essential to give the size of the first dimension ---eg. int func (int array [] [20], int x));--- when declaring a two dimensional array as a parameter of a function?
#include <stdio.h>
main(t,_,a)
char *a;
{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d...
If I define
#define array "abcdef"
int main()
{
printf("%c", array[0]);
return 0;
If I use that code is working and compile:
int main()
{
int array[] = {1,2,3,4,5};
printf("%d", array[0]);
return 0;
Hello. I have a problem. I want to define a constant array.
#include <stdio.h>
#include <stdlib.h>
#define array[] {'a', 'b', 'c'}
int main()
Perfect thank you
#include <stdio.h>
int main()
{
double a=0;
printf("Give a Float number (ex. 346.58)");
scanf("%e", &a);
printf("\n\n---->%lf\n\n", a);
GCC Compiler.
I use two kind: FreeBSD and Fedora
With %le the result is 5.609771e-315.
But I want 346.58.
Hello again. I have problem with double printing.
#include <stdio.h>
int main()
{
double a=0;
Perfect Thank you
Thank you very much.
But if I print
printf("\n\n%f\n\n", k);
the result is 1.5899. How I disable round in printf?
Hello to everyone, I have a small problem.
My example code:
#include <stdio.h>
int main()
{
I im reading Williams Stalling book for operating systems and he use semaphores , monitors and message passing. I just want to see real c code of monitors example.
Thank you.
Hi. How can I write a monitor form my multithret program? Where I can find examples for c?
Thank in advance
Any other way. Some dll or library that I can use? And some good documentation that I can start form with a simple tutorial?
Any one who knows how to use cygwin dll to write a cd burning software?
Where I can find tutorials or documentation?
What Libraries, sdks I need to write a cd burning software?
linux. bmp
type x = (type *) malloc(sizeof(type));
sizeof(type) counts the size of the variable for example
(int*)malloc(sizeof(int))
get 4bytes mem
#include <stdio.h>
int main (){
int counter;
int counter2;
system("clear"); //clear the consol
for (counter=1; counter < 6; counter++){
printf("| ");
for(counter2=1;...
I want to write with c a picture viewer what libraries I will need?