Search:

Type: Posts; User: yj1214

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    408

    I want to learn network programming with C

    I have decent knowledge of C programming and have had experiences with libraries such as GLFW, OpenGL, Irrlicht, Allegro, portaduio etc.

    But now I want to learn how programs like chatting...
  2. Replies
    3
    Views
    692

    #include #include ...

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


    typedef int gbType(int);
    int *createFunction(int x);
  3. Replies
    3
    Views
    692

    Function returning pointer variable...

    int *createFunction(int x);




    int main(){
    int *foo = createFunction(35);

    printf("%d\n", *foo);
  4. FILE * file = fopen(filename,"w+b"); Thanks!...

    FILE * file = fopen(filename,"w+b");

    Thanks! binary mode solved the problem!

    I can't believe I forget to use binary mode...
  5. I think my sound.wav is 177,084 bytes long...do I...

    I think my sound.wav is 177,084 bytes long...do I need to change some kind of settings in order to play the sound? thanks.
  6. Yes, I tried on Audacity and it's still noise...

    Yes, I tried on Audacity and it's still noise wave, not sine wave...

    If I find an answer, I'll post here...
  7. So I guess it doesn't work on Windows. Or does...

    So I guess it doesn't work on Windows. Or does it? I tried your method but it still makes noise. Also, is c99 better than c11? it seems like lots of poeple use c99...
  8. My code should make sine sound. But instead, it makes noises...

    wavfile: A Simple Sound Library


    I copied exact code form above website and ran the program but it' not working...

    It is supposed to make sine wave but instead it's making noise sound...

    ...
  9. Decallocate heap memory in different function.

    void *foo(){
    int *x = malloc(56);

    return x;
    }


    int main(){
    int *y = foo();
    free(y);
  10. Replies
    6
    Views
    1,979

    I think I almost got it but I have a small glitch...

    I think I almost got it but I have a small glitch in my program.





    int main(){
    char *sentences = convToChar("tfile.txt", 96, 15);
    printf("%s", sentences);
  11. Replies
    6
    Views
    1,979

    How do I add char array to another array?

    const void *convToChar(const char *file_path, unsigned int char_length, unsigned int line_length){
    FILE *file;
    char f_text[char_length + 1];
    char text[char_length + 1];
    file =...
  12. Alright, correct me if i'm wrong. char...

    Alright, correct me if i'm wrong.



    char *sentence = "Hello";
    sentence holds an address of a first element of the array which would be 'H' in this case.



    char sentence[] = "Hello";
  13. Sorry guys i'm holding this topic too long but I...

    Sorry guys i'm holding this topic too long but I just wanted to make sure that i'm understanding this correctly.



    char *sentence = "Hello World!";
    [/code]

    sentence is a pointer variable...
  14. Replies
    10
    Views
    4,118

    Well, from my personal experience, when I decided...

    Well, from my personal experience, when I decided to learn C++, I bought 2 popular(and bit expensive) books to learn how to program in C++. But I soon realized that it was very hard and non-newbie...
  15. I have another question. int *x = 5; ...

    I have another question.



    int *x = 5;


    If pointer takes an address, how come the code above is executable? I mean in C++ I can't even compile this code...
  16. How come char pointer doesn't need an address sign?

    This is how normal pointer works...



    int x = 5;
    int *pX = &x;



    But how come char doesn't work that way?
  17. Replies
    6
    Views
    1,264

    g++ -std=c++11 main.cpp -o main.exe -L/lib -lSDL2...

    g++ -std=c++11 main.cpp -o main.exe -L/lib -lSDL2 -SDL2main

    ^this one gives me an error that says it cannot find SDL2 and SDL2main.



    g++ -std=c++11 main.cpp -o main.exe -L. -lSDL2 -lSDL2main...
  18. Replies
    6
    Views
    1,264

    I tried that but still it doesn't work. Also, I'm...

    I tried that but still it doesn't work. Also, I'm using windows8 and this my error message.


    c:/mingw/bin/..lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed operation
  19. Replies
    6
    Views
    1,264

    g++ why is -L not working?

    Whenever I put my dll files in the same directory as my main.cpp and use this code,
    g++ main.cpp -L. -lMyDll it works.

    but if my dll files are in the other directory,
    g++ main.cpp -L/myDlls...
  20. Replies
    4
    Views
    1,457

    I'm trying to compile irrlicht game cpp file. ...

    I'm trying to compile irrlicht game cpp file.


    g++ -std=c++11 main.cpp -o main.exe

    error: undefined reference to 'imp_createDevice'
  21. Replies
    4
    Views
    1,457

    g++ what does -l do?

    I'm trying to link some libraries with g++ and i'm getting some errors.

    From what I've heard, -l used for specifying library name. But what does that mean? i'm getting an error whenever I put my...
  22. Replies
    1
    Views
    2,586

    Few questions about dll and lib...

    1. What is dll and lib?

    2. How do I make dll and lib using g++ command prompt?

    Also, how do I link libraries using g++?


    if you know any good websites that covers my questions, it would be...
  23. lolololololololololol

    lolololololololololol
  24. Replies
    1
    Views
    698

    Few questions about header file...

    I'm still learning C++ and there are things that I don't understand about header file...


    1. I have 3 files.(main.cpp, Foo.h, Foo.cpp)
    and this is how I compile with g++ command prompt.

    g++...
Results 1 to 24 of 24