257 Posted Topics

Member Avatar for Mounica Chirva

> I want to know if any such 2d game requires an IDE to compile or execute it succesfully? Using a modern IDE would definitely be a good way to go since you have a lot of options with them and your life would be much easier. (if this is …

Member Avatar for myk45
0
481
Member Avatar for marius2010

Hi, Firstly, convert your [number into a string](http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/). Then check if it is a palindrome. Also, paste code that you have already tried.

Member Avatar for WaltP
0
369
Member Avatar for nathan_drake

>Can someone help me on how to approach this program? I'm really lost. Any help is appreciated. have you tried giving it a shot? Anything at all? If yes, please post it here. If not, here are some thoughts that might help solve it. We can think of an optimal …

Member Avatar for SoreComet
0
242
Member Avatar for myk45

Hi All, This is a continuation of the [thread](http://www.daniweb.com/software-development/c/threads/434701/sizeof-operator) where there was an interesting discussion about interviews. Well, firstly, since in this forum, there are a lot of professionals here, and a lot of students who face interviews i felt we could have a thread dedicated to discussing about interviews. …

Member Avatar for aumshah
0
152
Member Avatar for myk45

Hello All, Kindly move this thread to an appropriate location. I apologize for the inconvinience. But, lately, (i guess last 15 days i suppose). I have crashes in Mozilla Firefox(details provided below). And the weirdest part is, in my crash report, all say: **Just switched tab to DaniWeb** I am …

Member Avatar for myk45
0
211
Member Avatar for nitin1

@deceptikon, Bob Now that we are discussing about questions in interviews, i am curious to know what kind of questions do you generally see people asking? As far as i have seen/heard many interviewers tend to ask things that you would find in any book. I mean something related to …

Member Avatar for myk45
0
269
Member Avatar for bhavin.chavada

Line number 13 and 15: you have missed an "&" See [scanf](http://www.cplusplus.com/reference/clibrary/cstdio/scanf/) Also, there are some other things i would like to mention: 1) # include<conio.h> --> Not standard C header 2) void main() --> Should be [int main](http://www.daniweb.com/software-development/cpp/threads/78955/void-main-vs-int-main) 3) clrscr(); and getch(); : Again, not standard.

Member Avatar for deceptikon
0
147
Member Avatar for Dev93

> I have just started getting into SFML and Visual studio as well Good. TC is quite old. New IDEs are way better on so many levels. >Q1. What is 'sf' ? Is it a class ? It is a [namespace](http://www.cplusplus.com/doc/tutorial/namespaces/). >Q2. Why is the operator '::' being used here …

Member Avatar for Bob
0
395
Member Avatar for soujanya.bhat.184

@OP: Quoting deceptikon: > Fix that and then trace through the execution in a debugger Did you try what he suggested? Do you not have a debugger? AFAIK, even very old IDEs come with a debugger wherein you can add watches and do some debugging. In the worst case that …

Member Avatar for soujanya.bhat.184
0
171
Member Avatar for Tinnin

Hi, `string::const_reverse_iterator rit = s.rbegin();` This should be outside the loop(just before the loop). You are creating a new iterator everytime you enter the loop. PS: This might be an interesting read: [Scope of variables](http://aelinik.free.fr/c/ch14.htm)

Member Avatar for WaltP
0
156
Member Avatar for volkang

Hi, try using [strerror](http://www.cplusplus.com/reference/clibrary/cstring/strerror/) to get some more details as to why you're fopen() seems to fail.

Member Avatar for volkang
0
352
Member Avatar for gopi17

> so far i have derive the algo and the pixels...but i don't know how to draw a line between those pixels Hi, OpenGL doesn't directly deal with pixel space. What i mean to say is, the API doesn't have functions to directly draw a line between two pixels. However, …

Member Avatar for myk45
0
341
Member Avatar for Tharsu
Member Avatar for jeets1892
Member Avatar for kesha.marufu

[Click Here](http://www.daniweb.com/software-development/cpp/threads/78223/read-this-before-posting-a-question)

Member Avatar for myk45
0
144
Member Avatar for murtazamzk

Use of goto is not advised. Have a look at the "Criticism and decline" section on the below link. [url]http://en.wikipedia.org/wiki/Goto[/url]

Member Avatar for soumava28
0
2K
Member Avatar for myk45

Hello All! To check for return values from a function and setting error flags, i am currently using the following approach: bool fine = true; fine &= func1(); fine &= func2(); .. and so on. if (!fine) { // error } Could anyone please let me know if there is …

Member Avatar for myk45
0
206
Member Avatar for sanghai45

Do you need to make a GUI for that? take a look at this: [Qt](http://qt.nokia.com/products/)

Member Avatar for sanghai45
0
228
Member Avatar for PinoyDev

@OP: How about using [sscanf()](http://www.cplusplus.com/reference/clibrary/cstdio/sscanf/)? you can trying something like `sscanf(buffer, "%d:%d", &a, &b); // where buffer is your string` So, you can check the return value of sscanf(). If it returns 2, then it means your string had the necessary pattern. So, you can directly parse and read pattern …

Member Avatar for WaltP
0
322
Member Avatar for bharath744

Post whatever you have tried. **Here is a hint**: you can use linear search.[but that would return the first occurance of your character though]. So, if your string is joohn, then 'o' would still return 1.

Member Avatar for myk45
0
41
Member Avatar for myk45

Hi all! This is w.r.t the thread [How to make my C++ program executable on other computers](http://www.daniweb.com/software-development/cpp/threads/431194/how-to-make-my-c-program-executable-on-other-computers) I didn't want to continue the discussion there, so i created the new thread. I had faced the same problems in the past. I needed some clarification on the following: 1)`The option shown …

Member Avatar for myk45
0
319
Member Avatar for piero.costa

> But I had no success. I get a bunch of errors and warnings Could you post them here?

Member Avatar for rubberman
0
757
Member Avatar for Bumpehh

I'm not sure i follow you completely. Do you want to use a game engine[that maybe provides an editor of some sort] to create a game? OR Do you want to see the internals of the game engine? Anyway, here is a list of game engines. Some seem to have …

Member Avatar for myk45
0
235
Member Avatar for myk45

Hello All! Well this is not exactly a C++ question. Please let me know if this needs to be posted elsewhere. So, here it goes: I have a project, cosisting of the entire buildrules in Makefiles. This has been built only on Linux. Now, i need to build it on …

Member Avatar for myk45
0
220
Member Avatar for myk45

Hello All! I am a little confused about the memory allocated for an executable. Now, say for example, this is my code: int foo = 1; int main() { const char* bar = "hello world"; int num; return 0; } Now, the "hello world" part would be stored in the …

Member Avatar for myk45
0
300
Member Avatar for myk45

Hello All! I was just wondering if C++ classes could internally be represented in the following way: #include <stdio.h> struct A { int a; void (*ptr) (A *); }; void display(A *ptr) { ptr->a = 2; printf("ptr->a = %d", ptr->a); } int main() { A obj; obj.ptr = display; obj.ptr(&obj); …

Member Avatar for myk45
0
122
Member Avatar for maximchris

Hi, If i understand you correctly, this is what you want: You want to scale an object based on the mouse drag. i.e if the mouse is moved away from the object, you scale it more, and when you move closer to it, scale it less. Is that what you …

Member Avatar for myk45
0
241
Member Avatar for rohit61288

> I am trying to create a MS word file using c programming I'm not sure i understand your question. Do you want to create a text editor? and one that runns on an embedded device?

Member Avatar for myk45
0
146
Member Avatar for jumbowat

> I want to make use of pointers, I am new to C so don't know how to go about it Have you read about pointers? If not, get a good book, read about it. The forum lists a lot of good books on C. In case you still have …

Member Avatar for jumbowat
0
7K
Member Avatar for jinglylime

Can you please elaborate what the problem is? I am able to get squares one on top of the other. I have attached a screenshot, and i don't see the black screen you're referring to.

Member Avatar for emilo35
0
240
Member Avatar for nuclear

@OP Objects are generally specified in a **Local Coordinate System**. The ModelView Matrix transforms the objects into the **World Coordinate System**. This link maybe helpful to you: [Link](http://www.opengl.org/wiki/Vertex_Transformation)

Member Avatar for nuclear
0
264
Member Avatar for myk45

Hello. i was trying to solve this problem: [B]You’re given an array containing both positive and negative integers and required to find the subarray with the largest sum (O(N)). Write a routine in C for the above. [/B] i was able to find the largest sum. However,i had little trouble …

Member Avatar for VIKAS REDDY
0
726
Member Avatar for myk45

Hello, I'm trying to use the compiler optimizations for GCC 4.3.3. I used the following [URL="http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html"]LINK[/URL]as a reference. I'm mainly using the O2 and Os levels of optimizations. Could anyone please let me know if the order in which the options matters? Thanks in advance!

Member Avatar for myk45
0
208
Member Avatar for subrata_ushasi

You mean an application that includes all 3D functions? You would need a 3D graphics API like OpenGL or DirectX. There are several APIs built over these(at least over OpenGL) that simplifies a lot of things. For eg: OpenSceneGraph. So, you would basically need a good 3D API.

Member Avatar for myk45
0
300
Member Avatar for myk45

Hello! I have a sample application. I just put a breakpoint at the beginning of main(). The callstack pointed to a function called mainCRTStartup() and before that, the kernel32.dll was present(grayed out). Can anyone please tell me what these functions are, and who invokes them? Thanks in advance!

Member Avatar for deceptikon
0
143
Member Avatar for Odanaga

You seem to be missing the main() function. Is it in another file, included in your project?

Member Avatar for Odanaga
0
393
Member Avatar for myk45

Hello everyone, I came across the following in a book: [CODE]Keyword typename The keyword typename was introduced to specify that the identifier that follows is a type. Consider the following example: template <class T> Class MyClass { typename T:: SubType * ptr; ... }; Here, typename is used to clarify …

Member Avatar for myk45
0
100
Member Avatar for ntrncx

Well the first thing is to decide an API to program with. OpenGL and Direct3D are mostly used for 3D rendering, not much for 2D(although you can do it). i don't know if you there are 2D specific graphic APIs. There are loads of material available on OpenGL. 1) [URL="http://nehe.gamedev.net/"]NeHe[/URL]: …

Member Avatar for Dman01
0
180
Member Avatar for thebiff

You can loop through [B]argc [/B]and read values stored in argv[]. [CODE]for (i = 1 to argc) { read file argv[i] }[/CODE] You could do something like that. [URL="http://www.crasseux.com/books/ctutorial/argc-and-argv.html"]argc, argv[/URL]

Member Avatar for thebiff
0
359
Member Avatar for BoBok2002

Are you sure [B]SOIL_load_OGL_texture()[/B] is returning successfully? Also, have you specified the correct texture coordinates while drawing the shapes? [QUOTE]] but I still can't get the image to upload.[/I] [/QUOTE] Could you take a screenshot of the output and post it here?

Member Avatar for BoBok2002
0
1K
Member Avatar for Aman6o

"Glow an LED" is too vague a description. You need to provide more details. I had worked on such boards once. There, sending a 0 bit to the LED used to glow the LED. In your case, assuming sending a 0 to an LED glows it, this is what you …

Member Avatar for myk45
0
114
Member Avatar for kingcong83

You have the following errors. 1) No [B]using namespace std[/B] or [B]std::[/B] (for cout, string etc) 2)[B] void InputData(string, int[], int &);[/B] This function seems to take a string, but you are passing a string array here: InputData(playerNameAr, scoreAr, numPlayersAr); --> Line 25 3) Line 34 -> There is a …

Member Avatar for Schol-R-LEA
0
157
Member Avatar for lo0lo0999

1) [CODE]int n = SIZE ; [/CODE] That should be just before the loop, and initialised to SIZE - 1. 2) You don't seem to change front and rear, thus the termination condition never reaches. 3) A queue is a FIFO(First In First Out) data structure. What you are doing …

Member Avatar for lo0lo0999
0
306
Member Avatar for jamal30

Try using [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fprintf/"]fprintf[/URL]. You need to start with some code. Here, we can provide help after you have made an effort. Post what you have already written(if you have) or else, read about FILE I/O in C, and if you have doubts, you can post here.

Member Avatar for ashlock
0
98
Member Avatar for Jungletoe

You need to generate a texture ID, as you have mentioned. [URL="http://www.opengl.org/sdk/docs/man/xhtml/glGenTextures.xml"]glGenTextures()[/URL] You need to specify the data for the texture. [URL="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml"]glTexImage2D[/URL] You then need to specify the filtering technique you wish to use. [URL="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameter.xml"]glTexParameter[if][/URL] You also need to specify the texture coordinates using glTexCoord2[df] You can look into this …

Member Avatar for myk45
0
1K
Member Avatar for BITnur

[B]count [/B]holds the count of the digits in the binary number. for eg consider 101. 111 -> count = 3. b[0] = 1 b[1] = 2 b[2] = 4 c[0] = 1 * 1 c[1] = 0 * 2 c[2] = 1 * 4 Therefore, sum = 6. PS: What …

Member Avatar for BITnur
0
238
Member Avatar for izh

Well, first up, try to read contents of the file into whatever data structure you are required to use. [URL="http://www.cplusplus.com/doc/tutorial/files/"]File I/O[/URL]

Member Avatar for izh
0
248
Member Avatar for coding101

I'm not sure if standard C has any functions that do this. [URL="LINK"]LINK[/URL] You can try to use some compiler and OS specific functions, but that would reduce portability.

Member Avatar for N1GHTS
0
99
Member Avatar for Elmey

Hi, How about this approach: Convert the array into an integer after parsing through the entire number. i.e say for eg, the number is stored as [B]123.456[/B] Now, find the integer equivalent by looping through the array, i.e obtain 123456 and then, divide it by an appropriate power of 10 …

Member Avatar for Narue
0
288
Member Avatar for theCompiler

[QUOTE]i dont have idea what string function must be used to find consecutive characters . example is the word commit it will output the letter m[/QUOTE] Your question is not clear. What do you mean to say consecutive characters? The example you gave does not explain the problem well.

Member Avatar for nHulk
0
5K

The End.