Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
6
Posts with Upvotes
6
Upvoting Members
5
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
3 Commented Posts
0 Endorsements
Ranked #1K
~35.6K People Reached
About Me

Langs: C, C++, Python, x86 assembly and a bit of Java

Favorite Tags

53 Posted Topics

Member Avatar for Duki

Some plov and a glass of coke. Plov is like a russian meal containing rice, grated carrots and meat cut into chunks. [url]http://www.gumbopages.com/food/russian/plov.html[/url]

Member Avatar for Dani
22
17K
Member Avatar for munitjsr2

You don't have to loop through every byte read. You can do [CODE]fread(&(fname->data), sizeof(char), text_length, fptr);[/CODE] if you know the amount of characters in the file. Otherwise you can do [CODE] int i = 0; while(!feof(fptr)) { fread((&(fname->data)) + i, sizeof(char), 1, fptr); i++; } [/CODE] Remember that you must …

Member Avatar for AssertNull
0
3K
Member Avatar for jackshannon4

In your fragment shader (the uncommented lines) you're only calculating ambient color, which could give you the first and the second result (depending on input). This means you're not using normals at all. Also, have you checked the compilation log? Also take a look at how VBO drawing is done …

Member Avatar for jackshannon4
0
175
Member Avatar for Vaspar

C section would be more appropriate for OpenGL. > I am unable to understand 4th point (i have called glpushmatrix and glpopmatrix in it) but how it is going to update my scene glPush/PopMatrix modifies an internal OpenGL matrices stack. You switch between different stacks with glMatrixMode. glTranslate/Rotate/Scale affect the …

Member Avatar for Vaspar
0
790
Member Avatar for Dev93
Member Avatar for Dev93
0
390
Member Avatar for venomxxl

Hello I'm not new to C++ programming, but I have a question for you guys and gals :) So the code below compiles fine (due to that ugly workaround in main func), but that makes d_copy.field2 unitialized (0xCC bytes in MSVC). How would you change the code to make d …

Member Avatar for venomxxl
0
121
Member Avatar for now how abt tht

[url]http://en.wikipedia.org/wiki/Pointer_(computing)#C_pointers[/url] You must allocate space in memory for an integer. [CODE]int *n = NULL, m; n = malloc(sizeof(int)); // also check if n isn't null here *n = 5; m = 2; *n = m; free(n);[/CODE]

Member Avatar for jnawrocki
0
134
Member Avatar for SamY

Most operating systems use a second language (C would be the most popular) and as little assembly as possible (for portability to other architectures). Windows is an example of an OS written in C (and assembly for certain parts of its kernel). Linux is also a kernel written mostly in …

Member Avatar for Schol-R-LEA
0
271
Member Avatar for sergent

Some people like to keep their macros upper case, so they won't be confused with variable names. But generally that doesn't matter. It also doesn't matter whether you use long names for macro 'parameters'. When you use macros in your code, preprocessor does this: Original code: [CODE]#define SQUARE(blabla, blablabla) (blabla …

Member Avatar for Narue
0
168
Member Avatar for Digitalwolf

This is a correct way to do it: [CODE] int buflen = 1024; char *buffer = NULL; char *readbytes = NULL; int ret = -1; buffer = new char[buflen]; // you have to allocate memory for the buffer ret = recv(a, buffer, buflen, NULL); if(ret == -1) { // an …

Member Avatar for Digitalwolf
0
189
Member Avatar for hondros

A simple workaround (you forgot to add a HWND parameter to the window proc): system.h [code] #ifndef SYSTEM_H #define SYSTEM_H #include "stdinc.h" class System { private: void initD3D (void); void cleanD3D (void); void setUpHWND (HINSTANCE, LPSTR, int); HWND window; WNDCLASSEX windowClass; LPDIRECT3D9 d3d; LPDIRECT3DDEVICE9 d3ddev; HINSTANCE hInstance; LPSTR lpCmdLine; int …

Member Avatar for hondros
0
197
Member Avatar for coolbeanbob

Read this and look at the example: [url]http://www.cplusplus.com/reference/clibrary/cstdlib/srand/[/url]

Member Avatar for coolbeanbob
0
208
Member Avatar for matanking

You have to flush or close the stream to write data to the file. [url]http://www.cplusplus.com/reference/iostream/ostream/flush/[/url] [url]http://www.cplusplus.com/reference/iostream/fstream/close/[/url]

Member Avatar for venomxxl
0
219
Member Avatar for [Prototype]

To accept connections you also have to call listen ([url]http://www.mkssoftware.com/docs/man3/listen.3.asp[/url]). The thread that called accept will be waiting until it receives a connection. If the socket receives a connection, it will return. If it returns -1, then an error has occured. Otherwise a connection was established/accepted and it will return …

Member Avatar for L7Sqr
0
130
Member Avatar for lukename

You could say that. Dll's contain many 'export' functions and headers help to 'import' them into your application (if the libraries are linked to your application). Those headers also contain necessary definitions (structs and macros).

Member Avatar for venomxxl
0
108
Member Avatar for kooletz

Add a scanf for last name after the first name. [CODE] //... char name[20], lastname[20]; printf("Employee Name:\t\t\t"); scanf("%8s", &name); scanf("%8s", &lastname); //... printf("\n\tEmployee Name: %s %s\t\t", name, lastname); //... [/CODE]

Member Avatar for WaltP
0
183
Member Avatar for venomxxl

Ok, first of all, I'm not sure if this belongs to C section. Since WinAPI is written in C, I'll post here. I'm using OpenGL with Win32 windows (not sure how to call that). I can't switch to fullscreen mode after creating the window. I'm using Windows 7 (64-bits) and …

Member Avatar for venomxxl
0
540
Member Avatar for ichigo_cool

In general: C++ concepts: object oriented programming (OOP) Other: OpenGL/DirectX, math, good programming skills (and habits) What you need to know depends on what you want your engine to do. Is it going to be a 2D or a 3D engine? Do you want physics? Do you want to use …

Member Avatar for KazenoZ
0
225
Member Avatar for jonspeidel

First of all, you aren't stupid for wanting to know that. Curiosity is a good thing, because it helps you learn new things :) The CPU processes machine code. The machine code is (obviously) architecture specific (there are many architectures, like x86 or x86_64). An assembler or a compiler translates …

Member Avatar for Goalatio
0
178
Member Avatar for shauzi158

Maybe you didn't link the Allegro library to your executable. What linker are you using? Microsoft linker or GNU (binutils) linker? Are you using Visual Studio?

Member Avatar for gusano79
0
75
Member Avatar for dashure

16. [ICODE]p = scrambleArr(&a[0], 7, sizeof(int), &func);[/ICODE] 27. [ICODE]int *p = &index[0];[/ICODE]

Member Avatar for dashure
0
128
Member Avatar for spark69

1. [ICODE]stdin[/ICODE] is a file descriptor for console input, thus you can't use it to read from a file. You have to open a file with fopen(). For example: [CODE] //... FILE* f = fopen("file.txt", "r"); fgets(text, MAX_WORDS, f); //... fclose(f); [/CODE] 2. MAX_WORDS is the value of an integer …

Member Avatar for Narue
0
587
Member Avatar for markfw

C is a procedural language. You can imitate C++ classes with C structs. Check this out: [url]http://home.comcast.net/~fbui/OOC.html[/url]

Member Avatar for rubberman
0
86
Member Avatar for nemoo
Member Avatar for Ahmed sunny

I'll just ignore the post above. What do you mean "create a RAM disk"? (RAM isn't a disk...; it stands for Random Access Memory)

Member Avatar for Adak
0
2K
Member Avatar for ThatGuy2244

You can't display more than 256 different colors at the same time with VGA. I found a site which says that you can display 262144 (2^18; 6 bits each for red, green and blue) colors with VGA (that means you will have to modify the palette to display other colors). …

Member Avatar for ThatGuy2244
0
489
Member Avatar for HitnBooks

[ICODE]price < 0.0f[/ICODE] isn't right. Have you ever seen a book that costs 0$? :P You'll have to show us more code. Btw, those aren't called functions. Those are called methods (the first one is a constructor).

Member Avatar for venomxxl
0
145
Member Avatar for cayman

I think [ICODE]BYTE arrayOfByte[];[/ICODE] (add a semicolon...) would be a pointer too (I'm not sure because I've never used [] instead of a pointer). The rest of your code: [CODE] int main() { BYTE arrayOfByte[]; BYTE *ptrToArray = arrayOfByte; //... someFunc(ptrToArray); //... return 0; } void someFunc (BYTE *foo) { …

Member Avatar for cayman
0
130
Member Avatar for yashsaxena

[QUOTE=Buffalo101;1524984]C++: [url]http://www.daniweb.com/software-development/cpp/threads/134017[/url][/QUOTE] C != C++ Linux, IPv4: [CODE] #include <netdb.h> #include <sys/param.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> int main(int argc, char** argv) { hostent * record = NULL; in_addr* address = NULL; char* ip_address = NULL; if(argc != 2) { printf("usage: %s <hostname>\n", argv[0], argv[1]); return 1; } record …

Member Avatar for venomxxl
0
167
Member Avatar for zeeshanvirgo

Since you've posted in C section (not the best section to post things like that), I assume you want to start learning C. C++ is also an option. Once you're experienced with C/C++, it's easy to learn an another language (I found that easy). There are stickies on forums, like …

Member Avatar for venomxxl
0
80
Member Avatar for venomxxl

I'm writing a pure C game engine. I assert every pointer returned by malloc() in my code. Now I'm writing a function that will "slice" a loaded texture into new textures (parts of the parent texture). The parent texture is loaded correctly (other textures loaded by the same loader were …

Member Avatar for venomxxl
0
323
Member Avatar for rain_meiwah

(1) Server must send (write()) the bytes to the client (make sure the client is aware that he is going to receive those bytes and knows what to do with them). (2) Server must recognize (read()) "pwd" and "dir" so it can respond to client sending (write()) back a message …

Member Avatar for jamesbondbest
0
122
Member Avatar for +_+man

You can get some information about OS development here: [url]http://wiki.osdev.org/Main_Page[/url] .

Member Avatar for Goalatio
0
156
Member Avatar for markfisher

Just add a line to your .rc file: [CODE] ANY_NAME_FOR_THE_RESOURCE ICON "your_icon.ico" [/CODE] Works for just any app I compile. Btw, the question you asked has nothing to do with GDI.

Member Avatar for venomxxl
0
216
Member Avatar for Akatosh

You could try LoadLibrary and GetProcAddress from Windows API. LoadLibrary: [url]http://msdn.microsoft.com/en-us/library/ms684175(v=VS.85).aspx[/url] GetProcAddress: [url]http://msdn.microsoft.com/en-us/library/ms683212(v=VS.85).aspx[/url] It's very simple. [CODE] HMODULE DLL = LoadLibrary("SomeDLL.dll"); void (*DLLFunction)() = GetProcAddress(DLL, "DLLFunction"); [/CODE] You have to know the return type and argument types of a loaded function (procedure).

Member Avatar for Stefano Mtangoo
0
220
Member Avatar for VasquezPL

I have noticed one thing pretty weird in your code (the last bit). Why did you put an if-statement into a switch body? I bet that is the problem. Only use case's and default in your switch body. One word of warning. It's an English forum. If you're posting some …

Member Avatar for VasquezPL
0
156
Member Avatar for batchprogram

This [CODE] // sprite.h Sprite(SDL_Surface* surface, SDL_Rect frames[]); // sprite.cpp Sprite::Sprite(SDL_Surface* surface, SDL_Rect frames[]) { ... } [/CODE] could be the problem. Try using SDL_Rect * frames instead of SDL_Rect frames[]. I don't know if that's a solution because I only use OpenGL, hope this helps though.

Member Avatar for venomxxl
0
209
Member Avatar for Galdzor
Member Avatar for Kanoisa
0
181
Member Avatar for Buolbear4444

On 2008 I remember using my own Microsoft.VC90.CRT.manifest files instead of VC++ redistributable installation. For this you need to get msvcp90.dll and msvcr90.dll. Then you should get info about their version and target architecture. You can get the version number right clicking on the dll file and choosing "Properties". Then …

Member Avatar for venomxxl
0
170
Member Avatar for Stefano Mtangoo

You don't have to define a DLL entrypoint and I don't think you need to use __declspec(dllexport) on *nix (I don't know about static libraries but shared libraries don't need that).

Member Avatar for Stefano Mtangoo
0
144
Member Avatar for venomxxl

I'm writing a small game engine and I have a little problem. The code below shows the exact situation: Header1.h [CODE] #ifndef _HEADER1 #define _HEADER1 #include "Header2.h" namespace HNamespace { class HClass1 { public: HClass1() { } ~HClass1() { } HClass2 * A; }; } #endif [/CODE] Header2.h [CODE] #ifndef …

Member Avatar for venomxxl
0
101
Member Avatar for ankur_

I once made a small kernel just for pure fun. It was very poor and I can really advise you on just one part of it. > Memory management You can use parts (or whole) code from this site: [url]http://www.fourmilab.ch/bget/[/url] I believe it's GPL, find out for yourself. If you …

Member Avatar for ankur_
0
137
Member Avatar for shakunni

You can just [ICODE]fopen("file", "w");[/ICODE] to create the file if it doesn't exist. You can also try checking if a file exists using dirent.h on *nix, check this out: [url]http://opengroup.org/onlinepubs/007908799/xsh/dirent.h.html[/url] Hope it helps.

Member Avatar for venomxxl
0
118
Member Avatar for s.p.i.

In my opinion, creating merging the arrays and then sorting the merged array isn't a bad idea because it's simple. But that depends on what you seek - performance or simplicity. Everything is possible to code but depends on your experience and the amount of time to spend doing it. …

Member Avatar for s.p.i.
0
136
Member Avatar for cwarren13

I had once held a small project for Linux but that was a few months ago, and I hardly remember anything since it was my last project which I wrote for Linux. I mostly program for Windows now, but I'm not going to write my autobiography here! Here's a little …

Member Avatar for venomxxl
0
2K
Member Avatar for Bheeman89

Can you paste the errors you get? And possibly more code? By the first look I can advise to use pointers instead of int seat[][][][].

Member Avatar for Bheeman89
0
2K
Member Avatar for s_sridhar

There are several ways to develop key loggers on Windows. I'll list them in order worst to best: 1. You could GetAsyncKeyState() from W32 API in a loop, but I guess most of the anti-viruses would detect those easily. But it's worth to try if you are a beginner (I …

Member Avatar for Luckychap
0
166
Member Avatar for viki0077

Public is missing a colon, and get() method should look like this: [icode]long get () const { return x; }[/icode] Why do you need set method to be const anyway?

Member Avatar for winrawr
0
279
Member Avatar for venomxxl

Hello everyone, I started learning assembly yesterday. Yes maybe I chose a wrong guide but I have a little problem here. It's about getting some integers without a newline. That is probably very easy to solve but I was searching for a solution for a few hours and no results. …

Member Avatar for jt_murphree
0
202
Member Avatar for rosenberg_a

You might want to try something like this, but yes it uses more CPU and memory. [code]#define YOUR_ARRAY_SIZE 256 #include <string.h> char * getName(){ char buf[YOUR_ARRAY_SIZE]; sprintf(buf,name); return &buf[0]; }[/code]

Member Avatar for StuXYZ
0
154

The End.