257 Posted Topics

Member Avatar for zhanrah

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.

Member Avatar for Moschops
0
207
Member Avatar for ram619

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".

Member Avatar for ram619
0
92
Member Avatar for XodoX

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.

Member Avatar for myk45
0
53
Member Avatar for CityThrille

[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. …

Member Avatar for CityThrille
0
300
Member Avatar for askerknight

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. :)

Member Avatar for askerknight
0
149
Member Avatar for Labdabeta

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?

Member Avatar for Labdabeta
0
120
Member Avatar for myk45

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 …

Member Avatar for myk45
0
917
Member Avatar for mprabuw

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 …

Member Avatar for mprabuw
0
784
Member Avatar for tyricec

[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 = …

Member Avatar for tyricec
0
234
Member Avatar for tomtetlaw
Member Avatar for fkrafi

Maybe use command line arguments, read a file using it? [URL="http://www.cprogramming.com/tutorial/c/lesson14.html"]LINK[/URL]

Member Avatar for WaltP
0
234
Member Avatar for bonyjohn

>> 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.

Member Avatar for carljohn
0
230
Member Avatar for Alex Starkov

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 …

Member Avatar for Alex Starkov
0
252
Member Avatar for aKiLa.. :)

@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]

Member Avatar for Ancient Dragon
0
233
Member Avatar for logicmonster

What do you mean by [B][I]complete error checking after a user input from the keyboard[/I][/B] ? Could you give an example?

Member Avatar for abhimanipal
0
187
Member Avatar for fpm777

>>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]

Member Avatar for abhimanipal
0
114
Member Avatar for maxicube

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 …

Member Avatar for maxicube
0
148
Member Avatar for ira2010

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.

Member Avatar for myk45
0
99
Member Avatar for jithuvsjithu

@Soubhik Check [URL="http://en.wikipedia.org/wiki/OpenGL"] THIS [/URL]out. Hope that helps.

Member Avatar for Soubhik
-1
181
Member Avatar for ammukj

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.

Member Avatar for myk45
0
39
Member Avatar for myk45

Hello everyone, i'm having some problem with the following code: [URL="http://pastebin.com/KTKaVje8"]CODE[/URL] inputSouce is an abstract class and the rest are derived from it. The definitions for these are elsewhere. Now, [CODE]inputSource *irSources[4]; irSources[0] = new irSource(); [/CODE] This is giving me errors. i'm using VS2008. [B]error C2466: cannot allocate an …

Member Avatar for myk45
0
179
Member Avatar for rohan_k

@OP Do you mean you want to read a file into a char array? That is what your title suggests. Is there a typo error? [CODE]while (not_end_of_file) { read character into array } [/CODE] You can use fgetc() (other ways possible too) to read a character from the file. PS: …

Member Avatar for abhimanipal
0
244
Member Avatar for myk45

Hi, I had to do an experiment regarding the following (1) Setting up a linux box to work as a frame forwarding device, packet forwarding device and packet/frame filtering device. (2) Install public domain routing softwares on linux box so that it can become a router..a linux router. Can I …

Member Avatar for Hussain1986
0
95
Member Avatar for Protoroll

im not sure why you were doing this: [CODE]quotient = x / hexa;[/CODE] To convert from decimal to hex, try this: [ICODE] 1) Note remainder when divided by 16( i mean num modulo 16). 2) Divide number by 16(integer division) 3) Repeat steps 1 and 2 till you obtain a …

Member Avatar for Ancient Dragon
0
125
Member Avatar for SourabhT

You can try using the [URL="http://www.boost.org/"] Boost [/URL]library. And[URL="http://www.quantnet.com/cplusplus-multithreading-boost/"] here [/URL] is an introduction to multithreading using Boost.

Member Avatar for ziggystarman
0
116
Member Avatar for kahaly

>>[B]I first need to know how to split a string like "abcd" into a b c d separately[/B] Why don't you use an index? What i mean is, [CODE]char letterArray[100]; for (i = 0; i < strlen(str); i++) { letterArray[i] = str[i]; }[/CODE]

Member Avatar for myk45
0
125
Member Avatar for tomtetlaw

Well, to work in screen co-ordinates, you will have to use glDrawPixels. But it is really suggested that you do not use it. If i understand you correctly, you mean you want to directly draw a line on the screen in terms of pixels right? i doubt there is a …

Member Avatar for myk45
0
268
Member Avatar for Mayank23
Member Avatar for bramsever
0
563
Member Avatar for ikiag

Well by table, do you mean a 2D matrix? or a graphical table? with rows and columns? Please elaborate.

Member Avatar for ikiag
0
112
Member Avatar for PC_Intense

If you're looking for tutorials on OpenGL, [URL="http://nehe.gamedev.net/lesson.asp?index=01"]this[/URL] is a good one.

Member Avatar for myk45
0
89
Member Avatar for mackemforever

The [B]while (contReset=='n'||contReset=='N');//and this[/B] part comes in the end: [CODE]int main(void) { do { // this is where you had typed [I]this is the problem loop[/I] // code here } while (contReset=='n'||contReset=='N'); // here is where it needs to be. return 0; }[/CODE]

Member Avatar for chrjs
0
149
Member Avatar for myk45

Hello everyone, Well im currently going through OpenScenGraph. i could not understand this piece of code: [CODE]class OSG_EXPORT Group : public Node { public : Group(); /** Copy constructor using CopyOp to manage deep vs shallow copy. */ Group(const Group&,const CopyOp& copyop=CopyOp::SHALLOW_COPY); META_Node(osg, Group); ... // code coninues };[/CODE] Now, …

Member Avatar for myk45
0
142
Member Avatar for tushar_veer

If you are looking for just basic 2D shapes, i guess GDI would suffice: Take a look at [URL="http://www.functionx.com/win32/Lesson11.htm"]this[/URL]

Member Avatar for asma akram
0
98
Member Avatar for vineeshvs

Line 11 to 16 [CODE] //display result for (i = 0; i < 2; i++) { printf("\n"); for (j = 0; j < 2; j++) { printf("%d \t", result[i][j]); } }[/CODE] i ran the code, the above changes seem to work

Member Avatar for vineeshvs
0
249
Member Avatar for leedsfanatic

Well, could you post what is your requirement? and what was told to be "intense" in your code?

Member Avatar for peter_budo
0
118
Member Avatar for o0OPatriciaO0o

Try this: [CODE]#include <stdio.h> #include <math.h> double outputAbsoluteValue (double*number){ *number = fabs(*number); return *number; } int main(void){ double myNumber = 0.0; double absValue = 0.0; printf("Enter Real Number: "); scanf("%lf", &myNumber); absValue=outputAbsoluteValue(&myNumber); printf("\n Its absolute value is %f", absValue); getchar(); return 0; }[/CODE] 1) int main(void) 2) %lf as the …

Member Avatar for o0OPatriciaO0o
0
242
Member Avatar for thecstudent

How about this approach: [ICODE] Project(Main Task) | ----------------- | | Code for task 1 Code for task 2 [/ICODE] You can try this, instead of actually compiling two programs separately and trying to call one from the other.

Member Avatar for thecstudent
0
309
Member Avatar for alex-VX
Member Avatar for Rahuldg

Could you elaborate a little more? What do you want to do? Allocate memory dynamically? Use [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/malloc/"]malloc[/URL]

Member Avatar for myk45
0
111
Member Avatar for udaykrishnag

[B]>> later we have to find which is the storage format like 4:4:4 or 4:2:2 or 4:2:0..[/B] What do you mean by that? Can you elaborate a little. Here is a list of [URL="http://en.wikipedia.org/wiki/Image_file_formats"]image formats[/URL]

Member Avatar for myk45
0
26
Member Avatar for StickyTape

[CODE] a == 100;[/CODE] This condition is not satisfied in the first iteration. So, the loop is terminated. outside, c = 1 [CODE](c == 25)[/CODE] So, even this condition is not met.

Member Avatar for myk45
0
203
Member Avatar for seifhatem

Well you can try this: [CODE] while (count != required_line) { getline(----); // appropriate arguments count++; }[/CODE] [URL="http://www.cplusplus.com/reference/iostream/istream/getline/"]getline[/URL] And i agree with MosaicFuneral. Post whatever code you have already written

Member Avatar for Chronister
0
173
Member Avatar for l1ttledb

Welcome to Daniweb. [CODE] graphic_choice( char x )[/CODE] This could be the problem(line 172). Try this [CODE]char graphic_choice( char x )[/CODE]

Member Avatar for sree_ec
0
275
Member Avatar for Zvjezdan23

[CODE]#include <iostream> using namespace std; int main() { cout << "7 + 3 = " << 7 + 3 << endl; cout << "7 - 3 = " << 7 - 3 << endl; cout << "7 * 3 = " << 7 * 3 << endl; return 0; } …

Member Avatar for Zvjezdan23
0
143
Member Avatar for htowa

Post what errors you are getting. Also, indent the code using [ CODE ] tags, or just highlight the code with the option provided. Its hard to read unindented code.

Member Avatar for frogboy77
0
154
Member Avatar for dip7

What will the contents of the file be like? You can try something like this: i assume they are on new lines. So, is it 4bytes, separated by a newline character? So, you can read 4 bytes. Read it into a buffer. say unsigned char buff[4]; Now, check for your …

Member Avatar for dip7
0
117
Member Avatar for Hey90

[B]>>Each record is for a company with the following fields:[/B] It would be easier to help if you paste the relevant code here. EDIT: @alexchen. Sorry, i didn't see your post.

Member Avatar for Adak
0
803
Member Avatar for dan76

Well, i have not used pthreads much. [CODE]pid = fork();[/CODE] This does not create a thread. It creates a child process. You maytake a look at [URL="http://homes.dsi.unimi.it/~boccignone/GiuseppeBoccignone_webpage/MatDidatSOD2009_files/pthread-Tutorial.pdf"]This[/URL]

Member Avatar for myk45
0
219
Member Avatar for vbkumar

[B]>>how to write this program[/B] Take a pen, write it. Sorry to be rude. But please show some effort from your side. Its not fair on your part to just post a question like that and expect answers to show up. Paste whatever code you have written, or whatever ideas …

Member Avatar for vbkumar
0
147
Member Avatar for lochnessmonster

Well, in this case, there is no difference. By default, floating point literals are double precision. So, 1.5 is double by default. Check this out: [url]http://babbage.cs.qc.edu/IEEE-754/Decimal.html[/url] Thus, 1.1 != 1.1f So, [CODE]const double f1 = 1.1F; const double f2 = 1.1; [/CODE] Here, f1 != f2 (which can be seen …

Member Avatar for Narue
0
446

The End.