Sounds simple... but why isn't bookPtr = &theBook the same as
*bookPtr =theBook?
Type: Posts; User: Jasper
Sounds simple... but why isn't bookPtr = &theBook the same as
*bookPtr =theBook?
Hmm...Can I replace *area= A * B with area = &(A * B)?
void rectangleMath(double *area, double *perim, double A, double B)
{
*area = A * B;
*perim = (A + B) * 2;
}
This may sound like a simple question,but can u explain why we have to put
newOne=newPlanet(); ? Would it be ok if I just put newPlanet(); there?
void enterPlanets(List *list)
{
Planet...
Why can't I add anything to either keylist or locklist?Here's my code,
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include "key.h"
#include "lock.h"
Elysia, u mean Im supposed to allocate memory for code? If that is so,is the code below the way to do it?
keyCode = (char *) malloc(code * sizeof(char);
So.... should I change strcpy(ky->code , keyCode); to ky->code = keyCode; ? Ive tried it but it still gives the same exact error. Thkx
This has to do with modular decomposition. The code I gave was in the c file. This one below is in the h.file.
typedef struct
{
int id;
char code;
}Key;
Nope, I've double checked. I do have #include <string.h> .What's the problem then?Thkc
Im trying to initialize code with keyCode and id with keyId respectively. Why do I get ['strcpy' makes integer from pointer without cast]?
Key * ky_new(const char * keyCode, int keyId)
{
...
Can someone explain this to me with an example. Thkx very much :)
lc_toggle - This function accepts a struct lock * for the lock record and inverse the
value of isLocked (from...
whats the prefix C in C-char* string suppose to mean? is it to show that char is a constant?
Why is there no asterisk before lowest n highest in printf of main?
main()
{
...
printf("The average monthly rainfall in Melbourne is %.2fmm,\n" , total / 12);
printf("The lowest rainfall of...
But how do I change it to uppercase while retaining my constant?
assignment of read only location
...
int yes(const char * question)
{
do
{
any idea why i get 0.0000 printed out for slength instead of my wanted value?
...
int main(void)
{
struct Segment seg;
double seglength();
double slength;
Thkx. now its better. but why the num is not sum of my array elements? error wif my function?
noob here.Why is it I get big number for the three %2.1fmm instead of my expected 51.4mm etc..?
double rainTotal(double rainfall[12])
{
int i;
double total = rainfall[0];
...
Why is it that I do not get the date printed ?
int main()
{
...
char month[][MONTHS] = {"Jan", "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec"};
...
What is the advantages of incremental development approach?
thkx 4 ur help Elysia
Its the problem with my loop part. How do I fix this?
#include <stdio.h>
/* Define constant NUM_FIBON (number of fibonacci numbers) to be, say, 12 */
#define NUM_FIBON 12
int main()
{
...
Is there any differences between #include <cstdlib> and #include <stdlib.h> ?
</code>
int main(int argc, char * argv[])
</code>
Can someone tell me why there is the need of asterick for char *argv[]. Does this make argv[] a pointer?
A bit stuck here. Why is it that " One thing that arrays don't require that other variables do, is a reference operator when you want to have a pointer to the string."
Is there any difference btwn C and C++ pointers?Can someone explain to me the use of new and delete operators in C++?Thkx.