257 Posted Topics
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 … | |
Re: @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: … | |
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 … | |
Re: 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 … | |
Re: 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. | |
Re: >>[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] | |
Re: 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 … | |
Re: >>i just downloaded qt Did you download Qt Creator(the IDE)? | |
Re: Well by table, do you mean a 2D matrix? or a graphical table? with rows and columns? Please elaborate. | |
Re: If you're looking for tutorials on OpenGL, [URL="http://nehe.gamedev.net/lesson.asp?index=01"]this[/URL] is a good one. | |
Re: 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] | |
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, … | |
Re: 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] | |
Re: 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 | |
Re: Well, could you post what is your requirement? and what was told to be "intense" in your code? | |
Re: 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 … | |
Re: 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. | |
| |
Re: 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] | |
Re: [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] | |
Re: [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. | |
Re: 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 | |
Re: 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] | |
Re: [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; } … | |
Re: 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. | |
Re: 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 … | |
Re: [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. | |
Re: 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] | |
Re: [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 … | |
Re: 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 … |
The End.