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.2K People Reached
About Me

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

Favorite Tags
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
172
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
786
Member Avatar for Dev93
Member Avatar for Dev93
0
379
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
117
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
131
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
267
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
166
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
181
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
193
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
204
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
215
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
129
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
104
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
167
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
534
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
223
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
175
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
73
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
125
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
584
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
83
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
484
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
144
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
128
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
163
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
77