THANKS! I changed the code as you said and it works.
#include<stdio.h>
struct student
{
char name[30];
Type: Posts; User: staticalloc
THANKS! I changed the code as you said and it works.
#include<stdio.h>
struct student
{
char name[30];
okay, I made some changes to make it more readable
my compiler gives me several errors and warnings
like unknown field etc
#include<stdio.h>
void calcu (struct student* );
Im trying to pass elements of a structure to a function (call by reference)
This code suppose to work like this:
Enter students name and Points
then calculate points to grade in a function.
...
thanks Dave!
I figured out to use random integers and cast it double
if I need -0.5 to 0.5
int min -500 to 500
then divide by 1000
Hi there :D
could someone explain
rc= rand()% (max-min+1)+min ;
because I do not understand the term after modulus %.
I got this code from the homepage and was wondering how to use it...
silly me. THX!!!!!
well I use lcc win32, and it didn´t give a warning ar an error. :confused: Any suggestion?
Hi everyone
well I have a new problem that makes me go crazy.
let me explain this code
enter n, steps x1
example:
n=6 ; x1=1.25 ---->1.25 2.5 3.75 5 6.25 7.5
I added fflush to my code and it works!!! YES! It feels so good!
thanks guys
thanks to everyone for your reply, but this is still really frustrating. I dont get any error nor warnings. Whats wrong with my algorithm?
well I still can´t see why this programm wont work :confused:
#include <stdio.h>
#include <stdlib.h.>
FILE *fp;
well now the file didn´t change at all after "r+"
Im trying a simple file encryption.
I
/*very very simple encrytion*/
fp=fopen("message.txt","r+");
do
{
c=fgetc(fp);
xy=(c+1)%256;
fputc(xy, fp);
}while(c!=EOF);
fclose(fp);
Id like to pass 1 variable from main to funk and receive more than one back to printf on main.
Well I guess I can give an array from main then use the elements array(0...n] in funk and print it out...
Im so confuse :confused:
thx for your help. How about this example? which of this three is a pointer data type ?
int cars[5][4][3};
auto=cars[3][2][1];
auto=cars[3][2][1];
auto=cars[3][2][1];
int x;
.
scanf("%d",&x); &x <----- pointer data type?
how do I recognize a pointer data type?
whoohooo it works!
THX!
:D I need new glasses
#include<stdio.h>
#include<limits.h>
#define MAXIMUM INT MAX
.
.
quo=x/MAXIMUM;
.
is it Okay to define MAXIMUM to the value of INT MAX?
Im looking for some examples about C --> Nassi-Schneidermann diagramm.
1. void main() is bad? Am I suppose to use int main(){return 0;} ?
2. type cast is no no in C? I thought without type casting, malloc will return a pointer to void by default?
thanks for the advice and help.
Hi everybody!
Im an absolute beginner in c coding. I still have problems with dyn allocation and pointers. :rolleyes:
could somebody help me with this? It calculates the skalar product of 2...