Search:

Type: Posts; User: Countfog

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,519

    Thank you I think I understand it now.

    Thank you I think I understand it now.
  2. Replies
    5
    Views
    2,440

    Never mind, it works much better with sprintf(),...

    Never mind, it works much better with sprintf(), but thanks. Concatenate means to join words together, and sprintf() does that as well.
  3. Replies
    2
    Views
    1,519

    Need explanation of variable arg lists

    I'm reading the section of my book on Variable Length argument list functions, and I can't quite understand, how the following program averages the numbers. An average is to add the values and to...
  4. Replies
    5
    Views
    2,440

    Yea that works, but this is in the chapter on...

    Yea that works, but this is in the chapter on string and character functions. It doesn't really concatenate them, so my professor might not be satisfied. I will try sprintf()
  5. Replies
    5
    Views
    2,440

    Question about strcat

    I have to write a program. Its basically a "random self book writer".

    It uses random number generation to write sentences. It has 4 arrays of strings which are the databank for the words the...
  6. Replies
    9
    Views
    1,703

    Yep as you were posting this, I found a nice...

    Yep as you were posting this, I found a nice example of this in my book. Thanks. :)
  7. Replies
    9
    Views
    1,703

    This just prints hello though. What If I want to...

    This just prints hello though. What If I want to print "name"? Doesn't the pointer only point to the first element of the array?


    #include <stdio.h>

    int main( void )
    {
    char *words[] = {...
  8. Replies
    9
    Views
    1,703

    Cool I didn't know you could do that. Thats what...

    Cool I didn't know you could do that. Thats what I mean. What would I use to select each seperate word? Can you give me a sample printf statement with


    char *words[] = { "hello", "my", "name",...
  9. Replies
    9
    Views
    1,703

    Nope you don't quite understand what I mean. Let...

    Nope you don't quite understand what I mean. Let me rephrase it.

    I need a character array to hold about 10 words, and to have the ability to pick any of those 10 words and print them out...
  10. Replies
    9
    Views
    1,703

    Question on character arrays

    Is it possible to do the following?


    char s[] = " hello my name is john";

    And then to print, not the entire sentence, but only "hello" and then on another line to print "name" and etc.

    I'm...
  11. In the code I provided in the zip file, I already...

    In the code I provided in the zip file, I already have this prototype for a double linked list.


    struct listNode {
    char data;
    struct listNode *nextPtr;
    struct listNode *prevPtr;

    Now lets...
  12. Thanks a lot citizen, your explanation does make...

    Thanks a lot citizen, your explanation does make sense. There is one thing I probably still don't get about nodes themselves. Remember I have only my book to explain things to me, and you know how...
  13. single linked list to double linked list (help)

    I'm telling you I can't stand online programming courses in college, but what choice do I have? I have no live instructor. Its very difficult.

    I have an assignment. Convert a linked list to a...
  14. Replies
    10
    Views
    1,541

    Thanks a lot tabstop, I really do understand...

    Thanks a lot tabstop, I really do understand macros a lot more now. :D
  15. Replies
    10
    Views
    1,541

    Wow!!! So the macro is literally almost exactly...

    Wow!!! So the macro is literally almost exactly like a function. The book does not stress this point enough, it doesn't explain that I can put the entire code of a similar function into the macro and...
  16. Replies
    10
    Views
    1,541

    Ok still having trouble. Here is the function...

    Ok still having trouble.

    Here is the function that sums up the values of an array.


    int sum_array(int a[], int num_elements)
    {
    int i, sum=0;
    for (i=0; i<num_elements; i++)
    {
  17. Replies
    10
    Views
    1,541

    The reason why I think macros are different, is...

    The reason why I think macros are different, is because they are predefined before the program begins, it makes one think that anything outside of main cant be used the same way.

    Once again if I...
  18. Replies
    10
    Views
    1,541

    Ah youre right its so simple. (slaps self) ...

    Ah youre right its so simple. (slaps self)

    With all this confusion I forgot that I left x and y as abstract variables.

    Yea here I fixed the code. Output is 117


    #include <stdio.h>

    #...
  19. Replies
    10
    Views
    1,541

    Need help with macros (urgent)

    Hey, I'm new here.

    I am in a C programming course in my college. Its an online course so sometimes I can't get the help I need. I don't recommend taking programming as an online course. One really...
Results 1 to 19 of 25