Search:

Type: Posts; User: Jasper

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,207

    Pointer question

    Sounds simple... but why isn't bookPtr = &theBook the same as
    *bookPtr =theBook?
  2. Thread: Basic pointer q

    by Jasper
    Replies
    1
    Views
    1,197

    Basic pointer q

    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;
    }
  3. Thread: function call

    by Jasper
    Replies
    2
    Views
    915

    function call

    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...
  4. Thread: List

    by Jasper
    Replies
    2
    Views
    797

    List

    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"
  5. Replies
    14
    Views
    1,585

    Elysia, u mean Im supposed to allocate memory for...

    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);
  6. Replies
    14
    Views
    1,585

    So.... should I change strcpy(ky->code ,...

    So.... should I change strcpy(ky->code , keyCode); to ky->code = keyCode; ? Ive tried it but it still gives the same exact error. Thkx
  7. Replies
    14
    Views
    1,585

    This has to do with modular decomposition. The...

    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;
  8. Replies
    14
    Views
    1,585

    Nope, I've double checked. I do have #include...

    Nope, I've double checked. I do have #include <string.h> .What's the problem then?Thkc
  9. Replies
    14
    Views
    1,585

    Assigning something

    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)
    {
    ...
  10. Thread: lc_toggle

    by Jasper
    Replies
    4
    Views
    822

    lc_toggle

    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...
  11. Thread: C-char* string

    by Jasper
    Replies
    2
    Views
    1,039

    C-char* string

    whats the prefix C in C-char* string suppose to mean? is it to show that char is a constant?
  12. Thread: Pointer Problem

    by Jasper
    Replies
    2
    Views
    1,073

    Pointer Problem

    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...
  13. Replies
    5
    Views
    1,056

    But how do I change it to uppercase while...

    But how do I change it to uppercase while retaining my constant?
  14. Replies
    5
    Views
    1,056

    why do I get this statement?

    assignment of read only location



    ...

    int yes(const char * question)
    {
    do
    {
  15. Replies
    2
    Views
    1,907

    struct in function call

    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;
  16. Thread: rain

    by Jasper
    Replies
    3
    Views
    1,232

    num sum

    Thkx. now its better. but why the num is not sum of my array elements? error wif my function?
  17. Thread: rain

    by Jasper
    Replies
    3
    Views
    1,232

    rain

    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];
    ...
  18. Replies
    4
    Views
    1,271

    2D array of names

    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"};

    ...
  19. Replies
    2
    Views
    2,817

    incremental development approach

    What is the advantages of incremental development approach?
  20. Replies
    4
    Views
    2,543

    thkx 4 ur help Elysia

    thkx 4 ur help Elysia
  21. Replies
    4
    Views
    2,543

    !value required as left operand of assignment

    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()
    {
    ...
  22. Thread: Library

    by Jasper
    Replies
    1
    Views
    1,080

    Library

    Is there any differences between #include <cstdlib> and #include <stdlib.h> ?
  23. Replies
    8
    Views
    2,173

    Command line arguments

    </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?
  24. Replies
    1
    Views
    854

    Array of pointers

    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."
  25. Replies
    1
    Views
    983

    C and C++ pointers

    Is there any difference btwn C and C++ pointers?Can someone explain to me the use of new and delete operators in C++?Thkx.
Results 1 to 25 of 30
Page 1 of 2 1 2