Please stop saying insanities...
Type: Posts; User: Emmanuel Delaha
Please stop saying insanities...
srand() must called once and only once at the very begining of your code (in main(), probably).
dealdeck(deckptr , handsDelt[][52]);
What do you meant here ? It's not C.
for(x=3;x<7;x++)
{
for(y=2;y<15;y++)
{
deckptr -> suitValue = x;
deckptr -> faceValue = y;
First of all, you should fix that...
main.c:26: warning: return type of `main' is not `int'
main.c: In function `main':
main.c:37: warning: array subscript has type `char'
main.c: In function...
A floating point it generally is composed of
One sign bit
Some bits for the mantissa
Some bits for the exponent (one of them being the sign of it)
The internal representation of the...
According to the standard, this clearly invokes an undefined behaviour.
Should be
float mydouble;
scanf("%f", &mydouble);
or
You meant "%lf"
Pass the address of the array and its number of element.
int a[3];
f(a, 3);
rather than the address of a single variable :
int a;
[please, use the code tags (the [#] button)]
A
return 0; is missing...
Add a
(void) getchar(); before the return. It's a well known issue of Dev-C++. I hope it will be fixed some day,...
Sounds good to me:
Enter five numbers 1 2 3 4 5
arrayofints2[0]has a value of 1
arrayofints2[1]has a value of 2
arrayofints2[2]has a value of 3
arrayofints2[3]has a value of 4...
Redundent. Remember my quote:
Better to do that:
#ifndef PROGMAIL_H_INCLUDED
#define PROGMAIL_H_INCLUDED
#define MAX 120
#define NUM 20
It's not 'numerous arrays'. It's ONE array of numerous structures.
Why do you have two identical structure definitions ? A mail is a mail.
Unless you have planned some divergent evolution, you can remove the MAILR thing.
By the way, you don't need the tags.
...
The general idea is 'define before use'. Sticking to that makes code easier to write and read.
Correct. It was a last minute change on the IDE that I forgot to report on my editor from wher I do the copy and paste.
Agreed.
Last version:
...
Agreed.
VLA only works inside a block.
You code is buggy (buffer overflow etc.)
Try this. Ask for details if necessary
/*******************************************************
* Purpose: Design...
A header is not a good place for a function (unless you have C99 and 'inline'). You really want to write this cleanup function or to write some get_line() function of your own including fgets() and...
This is the expected behaviour when you use fgets() 'rawly'. It also 'catches' the '\n'. All you have to do is to 'clean-up' the string once you have got it (actually, fgets() is a 'line reader')
...
So you want to input several mails before saving them ? Unsafe, but if you insist, you can use an array of structs as mentionned elswere.
Of course a static array has a limited size. If you want a...
- Get the info
- Save the info
You should open your file in "a" mode. It will append to the end of it (or create it if non-existent)
Probably because you have a pending '\n' in stdin. I guess you are using getchar() or scanf() in you menu...
All inputs should be done with fgets().
No. I was just an example. The general idea is that when you use a structure, it's good design to pass the address of it to the functions.
The address can be the address of some object
void...
And of course, you will test the value returned by malloc() against NULL before using it.
sleep() (whatever the details) is not standard.