257 Posted Topics
Re: "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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: [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 … | |
Re: 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] | |
Re: 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. | |
Re: 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 … | |
Re: [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. | |
Re: The program seems to be fine. Except that, the variable index in line number 26 wasn't initialised to 0(but was used to index an array). It works fine after that change. | |
Re: This would be: [CODE]ptr->p->i = 3; So, --(ptr->p->i) = 2;[/CODE] So, a[2].z is what is being printed. Which is, "Jabalpur". | |
Re: Did you try [URL="http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx"]this[/URL]? It is by a member of Daniweb(guess who) :) And i feel it's really good. | |
Re: [QUOTE]Don't be confused... <dos.h> and <iostream.h> are libraries, part of my C++ and C Compiler. I used <dos.h> because it is required by my void printtime() subroutine. (Required for printing the system time in my program.) The <iostream.h> is used for Input-Output streaming function things. (Never mind the iostream.h, anyway. … | |
Re: Initialise low1 and low2 to a high value. Check [URL="http://www.cplusplus.com/reference/clibrary/climits/"]this[/URL] I just had them as 9999(all other numbers in the list were lesser than that.) and it works fine. Here is the [URL="http://ideone.com/gTwqQ"]working code[/URL]: PS: Kindly format code the next time you post. It will be easier to read. :) | |
Re: Well, how does the tutorial read the vertices? While creating the display list, it would be making vertex calls right? Maybe you can open up the code that does that and check how it is done? | |
Hello all, I am a little confused about .lib and .dll files. I always thought that .lib files refer to a static library and that a .dll is the dynamic library. Recently, i read that .lib files also act as a stub for a .dll and that the .lib files … | |
Re: Welcome to Daniweb :) Well, you can use a string comparison function. Use strcmp() if allowed or write your own version of it. In this: [CODE]while (fscanf(prabuinputfile, "%s %s %lf %lf \n", &Try.date, &Try.curr, &Try.buying, &Try.selling) !=EOF ) { // Add if condition here. } [/CODE] So, do a string … | |
Re: [CODE] int x; // Not initialising x and y. int y; int x1; int y1; int x2; int y2; int x3; int y3; int x4; int y4; x1 = x; y1 = y; x2 = x +100; y2 = y; x3 = x; y3 = y + 75; x4 = … | |
Re: Could you show the projection matrix that you have setup? | |
Re: Maybe use command line arguments, read a file using it? [URL="http://www.cprogramming.com/tutorial/c/lesson14.html"]LINK[/URL] | |
Re: >> Guyz please give me some project ideas for my main project. It would be easier to provide help if you mention what interests you and on what topic you would like to do your project on. | |
Re: I'm not sure what you're trying to do here. In case you are trying to convert a string into an int, this would work: [CODE]l = l * 10 + (number - '0');[/CODE] So, when the loop terminates, [B]l[/B] will have the integer needed. By the way, what is [B]cislo … | |
Re: @OP [QUOTE]i realised that i need to learn even more about c++ before setting out to explore the graphics..[/QUOTE] Not really. You can use C. OpenGL has bindings for several languages. Take a look at [URL="http://www.opengl.org/resources/bindings/"]THIS[/URL] | |
Re: What do you mean by [B][I]complete error checking after a user input from the keyboard[/I][/B] ? Could you give an example? | |
Re: >>Compare 2 files helppppppp That does not tell us much about what problem you are facing. Help can be provided only when you tell us what the problem is. PS: [B]#include<iostream.h> -> #include <iostream>[/B] (why iostream anyway?) [URL="http://members.gamedev.net/sicrane/articles/iostream.html"]LINK[/URL] What compiler are you using? Also, [B]void main() -> int main(void)[/B] | |
Re: It is because of this: [CODE]glutIdleFunc(display); [/CODE] display() is being called continuously, since you have registered it as the idle callback. The window does move. The problem is there are too many idle calls. Give some delay, that will work. PS: Its not a good idea to register the display … | |
Re: Where exactly are you reading a string? [B]getc[/B] is used to get a single character. You can try using fscanf() instead, and obtain a string. i hope this helps. | |
Re: @Soubhik Check [URL="http://en.wikipedia.org/wiki/OpenGL"] THIS [/URL]out. Hope that helps. | |
Re: 1) To do object tracking, you can use OpenCV (an image processing library built using C++). 2) To simulate mouse events, you can go for OS specific functions. For example, on Windows, SetCursorPos() to set the cursor position in screen coordinates. |
The End.