15,300 Posted Topics
![]() | Re: [URL="http://www.google.com/#hl=en&source=hp&q=intel+assembly+tutorial&aq=2&aqi=g10&aql=&oq=intel+assembly&gs_rfai=Cm7M_qMV_TJq5FY_KMrbywLsEAAAAqgQFT9DuKV4&pbx=1&fp=fbb82a6afec8c3ff"]tutorials[/URL] ![]() |
Re: OMG You can learn to create a c++ library in about an hour (or less). With VC++ 2010 Express (and older versions) I can create one in less than one minute. If you have to take 3 months to do that then you are wasting everyone's time. | |
Re: [QUOTE=selvankarthick;1097985]i using windows xp i install the turboc when i click tc but it open and close immediately[/QUOTE] Good :) Now get yourself a newer free compiler such as Code::Blocks/MinGW or VC++ 2008 Express. | |
Re: I would consider such emails as spam and a big turn off. I would not want DaniWeb to send me such emails. It is no big deal and most members probably could care less whether a thread is marked solved or not. | |
Re: [QUOTE]maybe you may just try to POST REPLY rather.[/QUOTE] Good Grief :S don't do that or you will get flagged as an idot and hijacker. | |
| |
Re: >>filename="Synthesis//"+itoa(SynthNumber)+".txt"; I suspect that is the line that is wrong. The result of that is "Synthesis//1.txt", which has two / characters, not one. \ is the escape character, not /. So [icode]filename="Synthesis\\"+itoa(SynthNumber)+".txt"[/icode] would be correct. If you want to use / then ok but you only need one of them. | |
Re: Welcome to DaniWeb >>since the technologies keep changing I always feel like a beginner! I know that feeling well. | |
Re: what compiler are you using? Most compilers will consider line 58 an error and C compilers will not let you declare variables anywhere except at the beginning of a block surrounded by { and }. line 67: That is the first place where your program crashes. Its because the players … | |
Re: typecast it [icode] pointer = (int **)stuff;[/icode] | |
Re: something like this [code] void compute(int n) { int iterations = 0; printf("n = %d -- ", n); while( n > 1) { if( (n%2) == 0) { n /= 2; } else { n = (3*n)+1; } printf("%d ", n); ++iterations; } printf("\niterations = %d\n",iterations); } int main() { … | |
Re: That program is only processing the last line of the file, not the entire file's contents. Each time getline() is executed on line 18 it replaces the current contents of variable [b]line[b] with another string that is read from the file -- in otherwises getline() doesn't just tack the new … | |
Re: Here are some of my favorites codeproject.com programmingforums.org stltoday.com dreamincode.net/forums forum.codecall.net go4expert.com ubuntuforums.org sodahead.com | |
Re: What operating system? MS-Windows you can use win32 api drawing functions. There is some code [URL="http://www.daniweb.com/code/snippet216344.html"]here[/URL] that may get you started. That just shows how to draw a circle. There are other win32 api functions to fill it in with a color of your choice. | |
Re: If you want variable [b]choice[/b] to contain either a number or a chracter then you will have to change its data type to [b]char[/b] instead of [b]int[/b]. Then the cases would become [code] bool done = false while( done == false) { // display menu here char choice; cin >> … ![]() | |
Re: That has two two-dimensional arrays of unknown sizes, and a one-dimensional array of unknown size. How does the program that uses that structure know their dimensions? Without knowing the dimensions it will be impossible to serialize it anywhere, much less actually use it for anything. | |
Re: How to create new threads is operating system dependent. MS-Wiondows does not support the POSIX. boost libraries try to be os independent. [URL="http://www.google.com/#hl=en&source=hp&q=boost+multithreading&aq=4&aqi=g1g-s1g8&aql=&oq=boost+multi&gs_rfai=C7sHY8EZ2TJbmDpXcygSRiYEGAAAAqgQFT9DEFLs&pbx=1&fp=ad526d12389e3c08"]Here are a lot of related threads[/URL] | |
Re: Welcome back. But that means you're only 14 now. A little better, older, and wiser, but not much. Stick around until you are at least 18 and you might have a little common sence by then :) | |
Re: Other options: 1) Get the source code and compile them yourself with whatever compiler/IDE you want 2) Make one of them a DLL | |
Re: make sure the *.cpp file includes fstream before class_array.h and add std:: [icode] friend std::ostream& operator<<(std::ostream& out,const Array& arr);[/icode] | |
Re: If the following doesn't fix the problem then the problem is in the way the data is being input as posted in your first code snippet. [code] int i,n1; FILE *file = fopen("db.dat", "wb"); cout<<"Writing into file\n"; if ( file != NULL ) { fwrite(r, sizeof(r[0]), n,file); fclose(file); } cout<<"Writing … | |
Re: I had a woman as a team leader for nearly 10 years before I retired three years ago, and I can say that she was just as competent as any of the men who worked for her. As for age -- over 50% of the 200 people who worked for … | |
Re: you have a couple options 1) call setenv() function. The variable will disappear when the c++ program exits. 2) write a shell program to call your program and capture its return variable. Then return the value of the variable from main() so that the shell program can grab it and … | |
Re: It will depend on the company you want to work for, but equivalent experience usually means a paid job for at least 4 or more years. Just doing hack work between ages 10 and 14 don't do it. Somebody needs to pay you $$$ for your work. | |
Re: Pass it just like you would any other array [code] class foo { public: foo(char **ar, int n) { } }; int main() { char** mz = new char*[5]; for(int i = 0; i < 5; i++) mz[i] = new char[5]; foo f2(mz,5); } [/code] [edit]Oops! Sorry Narue, I didn't … | |
Re: If you are so smart why can't you figure this out yourself?? Smart boys and girls will at least attempt to solve the program and post what they have done. They also read the forum Rules and know that we don't do people's homework for them. | |
Re: Unusual and unconventional approach. If you are going to do that then you might as well use a while loop instead of a for loop. | |
Re: Never ever for any reason whatsoever include one *.cpp file in another. Even C# does not do that. Each *.cpp file has to be compiled on its own and then all of them linked together at link time. Exactly how to do that will depend on the compiler/IDE that you … | |
Re: The instructions are a little unclear. Is the data coming from a text file, or do you have to input it from the keyboard, or both? | |
Re: line 13: name needs to be larger than 30 characters. Most people's names are at least that big, unless its something like "Mike Smith". You need to make it large enough to hold any reasonable-length name. line 33: cin >> does not allow spaces in the name. So "Eter full … | |
Re: Dev-C++ is very old and outdated, and used an old version of gcc compiler. Replace it with Code::Blocks/MinGW and you will have few problems. | |
Re: It might be compiler dependent, I don't know, but in VC++ 2010 Express references do not occupy memory [code] void foo(int& ref) { printf("foo: %p\n", &ref); } int main() { int ival = 123; int& ref = ival; printf("%p %p\n", &ival, &ref); foo(ival); } [/code] And the output is [quote] … | |
Re: 1)seek to end of file [code=] Start of loop Read a record // back up two records, file.seekg(-(2* sizeof(Transation_Info), ios::cur); beginninng of file? yes, then exit loop end of loop [/code] | |
Re: There are probably lots of way to do it. One of the easiest is to create a fixed-length structure then save it to the file in binary format [code] struct person { char lname[40]; char fname[40]; char mi[3]; int id; // other fields here }; // save to a file … | |
Re: Here is one way to do it [code] int main() { FILE* fp; unsigned char* buf = 0; unsigned int size = 0; // open the jpg file in binary mode fp = fopen("filename.jpg","rb"); if(fp == NULL) { printf("Error\n"); return 1; } // get file size fseek(fp,0, SEEK_END); size = … | |
Re: define a structure [code] struct coord { int x; int y; int z; }; [/code] | |
Re: [QUOTE=Teka;310117]I immediately need to find a project title for my sem project Please send any emerging topic for me. I am doing my B.sc computer Science final year[/QUOTE] Did you forget to ask a question or post a response :?: :?: Just quoting the oritinal posters question isn't really helping … | |
Re: In Forms designer, double click on the button and the IDE will generate an OnClick event handler. Then just add the code shown below. [code] #include "Form2.h" <snip> private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { Form2^ form2 = gcnew Form2; form2->Show(); } [/code] | |
Re: Great news for people who play games. Now if they would just do the same with old movies :) I have a house full of movies I'd like to get rid of. | |
Re: The best way to learn c++ is to buy a book. There is an entire thread devoted to that topic [URL="http://www.daniweb.com/forums/thread70096.html"]here[/URL]. That thread was started 6 years ago but its still relevant because the language has not changed much since then. ![]() | |
Re: That's the strangest C code I've ever seen. | |
Re: Today is ok but it was pretty slow a couple days or so ago. Sometimes its my ISP, not DaniWeb. | |
Re: NULL is traditionally meant to only be used with pointers, never integers or characters because originally NULL was defined as [icode]#define NULL (char *)0[/icode] So to check for the string's terminating character it would be [icode]for(size_t n = 0; myStr[n] != 0; n++)[/icode] C++ now normally defines NULL as 0, … | |
![]() | Re: I don't see any way to do that either in Code::Blocks. But it is quite easy with VC++ 2005/8/10. That has an option to add a new project to the existing solution, which is what you want to do. |
Re: >>5+6+8+9+7+9+8+8 = 58 Wrong. you have 8 listed in both the last two digits. Should only be 5+6+8+9+7+9+8=52. 5+2=7. At any event you need a loop that uses the mod operator % (e.g. num % 10) to extract the digit and divide operator / to remove it from the number … | |
Re: It appears the problem is that new numbers are being added to the head of the list, and you need them added to the tail. Change lines 44 and 45 to add the new node to the end of the list. | |
Re: strcpy() does not work with single characters -- it works with entire null-terminated character arrays. If you want to copy just a single character than simply use the = assignment operator. [icode]post[j] = in[x];[/icode] | |
Re: Peter: you don't get the error because as a moderator you have access to that link. We normal humans don't. | |
Re: @blitter: If you want to post code like that at least make it a complete function. | |
The End.