Search:

Type: Posts; User: whichet

Search: Search took 0.01 seconds.

  1. [QUOTE=cpjust;695015]You don't. Pass the char*...

    [QUOTE=cpjust;695015]You don't.
    Pass the char* buffer & size of the buffer to the function and write to those parameters.

    char* func( char* buf, int size )
    {
    char str[] = "Hello World";

    ...
  2. How to return a character array from a function?

    what is the correct way of declaring a function that return an array of characters?

    Also how do return array of characters from within a local function?
    I tried use a pointer to the variable that...
  3. Thread: Class In C?

    by whichet
    Replies
    1
    Views
    1,092

    Class In C?

    Hey bro!

    Can we implement Class in C?
  4. Replies
    2
    Views
    801

    problem with a string sorting function

    I am trying to a simple string sorting function since I am now learning array and string lesson. however, my function is not working as I expected.
    Could you please help debugging the code below?,...
  5. Thread: Class in C

    by whichet
    Replies
    14
    Views
    1,677

    Class in C

    Hi all, I am not sure with C about one thing, I know that C is not an Object-oriented language.
    so it means we cannot implement any class by using C?
  6. Replies
    7
    Views
    3,603

    Yes, you are right, I made the changes as you...

    Yes, you are right, I made the changes as you told, and it works.
    However, I am not quite sure, why we need to reset it. because when we pass the pointer to the functions, in the functions, I did...
  7. Replies
    7
    Views
    3,603

    Since ptr is an integer pointer for array, and p...

    Since ptr is an integer pointer for array, and p is just a pointer to a normal integer value, thus in theory, we need to cast the value to integer before assigning the value.
  8. Replies
    7
    Views
    3,603

    I will try this,

    I will try this,
  9. Replies
    7
    Views
    3,603

    Pointer with Multi-dimensional Array

    Hi, all I am having a trouble with pointer and multi-dimensional array.
    I wrote the same thing but I see different output. below is the code


    #include <stdio.h>

    void printarray_1 (int...
  10. Replies
    4
    Views
    1,290

    thank you :)

    thank you :)
  11. Replies
    4
    Views
    1,290

    is it the C tutorial or C++ one? because, I saw...

    is it the C tutorial or C++ one? because, I saw C++ code:

    http://www.cprogramming.com/tutorial/lesson15.html


    conductor = root;
    while ( conductor != NULL ) {
    cout<< conductor->x;
    ...
  12. Replies
    4
    Views
    1,290

    A good tutorials of Linked List

    Hey, Do any of you know a good source of tutorials for C linked list??
  13. yeah, RIGHT!!! int a[] is the correct form in...

    yeah, RIGHT!!!
    int a[] is the correct form in C!

    However, I am asking them to clarify about that.
  14. One question about array and function prototype declaration

    Hello all, do you think this below code will be compiled and work???
    I used VS 2005 and it did not work. but I haven't tried any other compiler yet!!.
    I will have to take exam about C programming....
  15. Replies
    9
    Views
    22,360

    size_t????

    Then, I have one question, why do we have to use size_t????, why don't we use int??
    i just know that size_t can be the same as unsigned integer or unsigned long. I hope you can clarify this, since I...
  16. Replies
    9
    Views
    22,360

    count elements in an array

    Hi, all!

    do you know if there is any predefined function to count all the element in an array? or we have to write such functions ourselves?

    for instance: if i have an array like this below:
    ...
  17. Replies
    160
    Views
    1,230,466

    Sticky: For me i am new to c programming! And i don have...

    For me i am new to c programming! And i don have much time either. Thus i like teach yourself C in 21 days by sams publishin. I use it as a guide what i should learn day by day and try to any other...
  18. Thanks for givin the explanation. I got that. But...

    Thanks for givin the explanation. I got that. But when i start to learn about pointer and string, i get confused! I have been tryin to read more about it now. Maybe you can suggest to me a good...
  19. So it means i have to use de strcpy when i want...

    So it means i have to use de strcpy when i want assign any value to a variable of type char? Or is there any other easier way?
  20. problem with assigning a string value to a char variable

    Hey there! I am having a problem again but this time, just I am not so sure with the string in C.

    Why cant I do something like this below chunk of code???


    #include <stdio.h>
    int main(void)...
  21. Replies
    2
    Views
    6,496

    Fgets and pointer

    I am just trying to learn C, and now I am learning about pointer and string.!!!

    since the number of array elements in C cannot be increased at run-time, i am trying to write a test script like...
  22. if I wrote *ptr1++ = s1[i]; or ptr1++ =...

    if I wrote


    *ptr1++ = s1[i]; or
    ptr1++ = &s1[i];

    then my VS 2005 wont compile at all. It makes me so wondered in that I cannot assign the memory of the array element
    &s[i] to the...
  23. Problem with passing back pointer pointed to string

    I am trying to learn C programming, and I am doing an exercise that

    I need write a function that accepts two strings. Use the malloc() function to allocate enough memory to hold the two strings...
Results 1 to 23 of 23