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...
Type: Posts; User: yj1214
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...
#include <stdio.h>
#include <stdlib.h>
typedef int gbType(int);
int *createFunction(int x);
int *createFunction(int x);
int main(){
int *foo = createFunction(35);
printf("%d\n", *foo);
FILE * file = fopen(filename,"w+b");
Thanks! binary mode solved the problem!
I can't believe I forget to use binary mode...
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.
Yes, I tried on Audacity and it's still noise wave, not sine wave...
If I find an answer, I'll post here...
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...
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...
...
void *foo(){
int *x = malloc(56);
return x;
}
int main(){
int *y = foo();
free(y);
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);
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 =...
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";
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...
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...
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...
This is how normal pointer works...
int x = 5;
int *pX = &x;
But how come char doesn't work that way?
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...
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
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...
I'm trying to compile irrlicht game cpp file.
g++ -std=c++11 main.cpp -o main.exe
error: undefined reference to 'imp_createDevice'
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...
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...
lolololololololololol
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++...