Thank you for your reply! I understand what you mean, lately I'm programming too much in c++ and i forgot that c is not initializing anything. About the code, yes I copied paste it from an Idle so...
Type: Posts; User: babaliaris
Thank you for your reply! I understand what you mean, lately I'm programming too much in c++ and i forgot that c is not initializing anything. About the code, yes I copied paste it from an Idle so...
while ( fgets(line, 100, file) !=NULL )
{
char path[100];
int i =1;
strcat(path, cwd);
strcat(path, "/");
strcat(path, line);
printf("path is: %s", path);
Thank you so much!!! This is perfect .I really couldn't find it with google.
Hello!
i have this macro:
#define NBTEST(GroupName, TestName) int (GroupName)(TestName)()
I think i got it.
SMengine.h
#pragma once
class SMengine
{
Thank you, I'm on it right now!
No reason actually, but it seems to be the problem :p
Well i tried it but i get a bunch of weird errors when i compile it.
SMengine.h
#pragma once
Hello!
I'm creating a game engine using the SDL library and i stepped into a problem.
Say i have this definition:
SMengine.h
#include <SDL.h>
Every time you accept a client, accept returns you a socket object which you can use to communicate with the client. After accepting a client, you should create a new thread to handle the...
I tried to use -ggdb both in the CFLAGS and in the LINKFLAGS and also i combined -g and -ggdb together but no luck, still the same :(
I tried it, the result is the same :(
I also tried to compile it in a single line like this:
gcc <include paths> <link paths> -g -Wall -o main <source files> <shared_files>
But i get the...
Hello!
I have this make file:
#===========================Basic Macros===========================#
COMPILER = gcc
Nice tip!!
I thought the new reference was a new memory block. So i put that free there on purpose so you can tell me if its wrong :p
What do you have to say about this ;) (i think is good):
//Return's 1 for success, 0 otherwise.
int CString_ToInt(int *dst, char *string){
//Reference where the remaining string will...
So i followed Salem's advice, and i created these function wrappers:
//Return's 1 for success, 0 otherwise.
int CString_ToInt(int *dst, char *string){
*dst = atoi(string);
Yes, I should probably not bother. Anyway i was making this Library because i'm making a game in C and i need to play with strings. I guess strcpy, strcat, strlen, strcmp, sprintf, atoi, atof, will...
You are more that right, I should use sprintf.
#include <string.h>
int main()
{
float num = 12.34;
Yes you are right. There is not absolute value of INT_MIN since a signed int can't represent it. Math.h documentation says that abs(INT_MIN) result is undefined and u can't expect what you will get,...
I don't like that either, but i wanted to avoid arrays and sizes, i wanted to be more Java like :P not that i'm a java person, but this way is easier for the eye.
Now about an error, you are right,...
Hello! I'm new to this forum!
I'm creating a Dynamic C String Library and i'm not glad about a function i created (About Efficient), because it does so many allocations and deallocations based on...