Search:

Type: Posts; User: winsonlee

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,138

    qsort function

    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>


    int comp_nums(const int *num1, const int *num2)
    {
    if (*num1 < *num2) return -1;
    if (*num1 == *num2) return 0;
    if (*num1 >...
  2. Replies
    7
    Views
    2,128

    read function

    read(int d, void *buf, size_t nbytes);


    How can i use the above function to read a file and store the content of the file in char variable ??? I have got the buffer size already. But i dont know...
  3. Replies
    5
    Views
    1,271

    Memory Address

    How can i write to a piece of memory address ??

    lets say i would like to write a to a memory location at 10034, how can i archieve this ??
  4. Replies
    3
    Views
    35,999

    Convert Const Char * to string

    #include <string>

    void
    Calc::yyerror(const char * mesg) {
    string x;

    // how can i make this to work ??? I would like to copy the mesg to the x string.
    x = mesg;
  5. Replies
    1
    Views
    1,288

    how to create a tree of object

    There are three classes which name Plus, Mult and Constant. How can i make in such a way that the Mult class has a method that holds the 5 and 4 object which is created earlier and the Plus class has...
  6. Replies
    3
    Views
    976

    But i thought i can create a bbb object and pass...

    But i thought i can create a bbb object and pass it to the aaa constructor ???
  7. Replies
    3
    Views
    976

    Error cause by inheritance

    I tried the following code but i couldnt figure out why does the error occurs. Can someone let me know whats wrong with this code ??



    class Expression {
    public:
    Expression() { }
    virtual...
  8. Replies
    5
    Views
    1,198

    does it works just like how char *data works ???...

    does it works just like how char *data works ???

    char comes with c language it self. But Expression and Variable comes from where ??? Is it from a class?? Coz AssXX class and Variable is the...
  9. Replies
    5
    Views
    1,198

    What does this mean ??

    class AssXX:public Expression{

    private:
    Expression * lhs;
    Variable * rhs;
    };


    What does the Expression and Variable for the AssXX class means ??
  10. Replies
    3
    Views
    2,448

    sfmttime( str, sizeof(str)-1, "1) It's...

    sfmttime( str, sizeof(str)-1,
    "1) It's %A, %B %d\n", &today );

    I tried using the following function to store the string into str but i got the following error msg

    Message.cpp: In...
  11. Replies
    3
    Views
    2,448

    Getting time and date

    how can i get the time and the date from the pc and store it in variable ???


    eg :

    i wan to assign the current time which is 4.15pm to timex variable and 19/08/2004 which is today's date to...
  12. Replies
    5
    Views
    2,377

    The problem is both the string is from the...

    The problem is both the string is from the standard input. So i cant declare string as string[]. My second problem is the name after ">" always change. Sometimes it can be file1 sometimes it can be...
  13. Replies
    5
    Views
    2,377

    How to delete string after >

    char *string = "Hello how are you doing > file";
    char *string2 = "hello > file how are you doing";

    I wanted to to store the information in string one as

    char *stringx = "Hello how are you...
  14. How to detect what is the first character ??

    char *cdx[2];

    cdx[1]="/home/dir";



    How can i know if the first character is start with "/" or not ??

    if first char == "/" then
    return 0;
  15. Replies
    6
    Views
    1,763

    The following code is to store integer in a link...

    The following code is to store integer in a link list. How can i modify it so that it is able to store objects in a link list ? For your information, i am not asking solution directly for my...
  16. Replies
    6
    Views
    1,763

    Create Link List for object

    main.cpp

    LogMessage logM();

    Message m("hello world");
    Message mx("hello world");

    logM.log(m);
    logM.log(mx);
  17. Replies
    2
    Views
    925

    Whats wrong??

    private:
    string mySender;
    string temp;


    mySender and temp declared as string. I still couldnt figure out whats wrong with my following code ??



    string Message::getMessage() const {
  18. Replies
    1
    Views
    1,150

    Getting string after certain character

    char hello[]= "main(int";

    How can i extract the "int" from the hello string??
    I know the length of the string which is 8 and i know that the "(" start in position 5. From there, how can i proceed...
  19. Replies
    1
    Views
    1,501

    identifying string input

    How can i count the number of symbols found in C-code in filex.c ??

    eg:


    while 1
    ( 3
    ) 3
    } 1
    { 1
  20. How can i convert negative number to positive number ?

    How can i make in such a way that the negative is ignored before adding up the number ??

    Eg: I want the following the code to print out 13 instead of -1.



    double hello[]={-1,2,4,-6};
    ...
  21. Replies
    5
    Views
    1,307

    Something wrong with 'for' loop.

    When i tried using the strlen inside the for loop, it gives me the following warning msg. I would like to know why this happend ??

    "warning C4018: '<' : signed/unsigned mismatch"




    for(i=1;...
  22. Replies
    2
    Views
    1,095

    Whats wrong ??

    x = 2/4;
    printf("%f", x);


    Output:
    0.00000

    How can 2/4 result is 0.000 ?? How can i make the output so that it is 0.5
  23. Replies
    5
    Views
    1,291

    i know whats wrong already. I didnt declare the...

    i know whats wrong already. I didnt declare the size of the array.
    Thanks anyway..
  24. Replies
    5
    Views
    1,291

    May i know whats wrong with this code ?? There...

    May i know whats wrong with this code ?? There isn't any error while compiling. But when i try to build the file that time, it display the following error


    "Linking...
    prac3a.obj : error...
  25. Replies
    5
    Views
    1,291

    If i use the first option, when i wanted to print...

    If i use the first option, when i wanted to print that time, woudlnt it be ..?

    printf("%s", array[0]); // john
    printf("%s", array[1]); // 45
    printf("%s", array[2]); // darwin
    printf("%s",...
Results 1 to 25 of 41
Page 1 of 2 1 2