15,300 Posted Topics
Re: do you mean concatenate two strings? First make sure the destination buffer is large enough to hold both strings. Next make sure the destination string is not a string literal because string literals can't be changed. Call strlen() to find the end of the destination string. Then create a for … | |
Re: google for [URL="http://www.google.com/search?hl=en&q=ascii+chart&btnG=Search"]ASCII Chart[/URL] -- there are millions of them on the net. Then in C++ code \xHH is hex code, like this [code] cout << "Hello my name is \x4d\x65" << endl; [/code] | |
Re: [QUOTE=ashok_kumar786;413211]Hello Friends, I have got a program for Checking the number that is it Armstrong or not. and to genrate a list of armstrong no. below 1000. The program is in C++.[/QUOTE] Great work! So you copied it from [URL="http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/chap04/arms.html"]here[/URL] then ported it to c++? | |
Re: use CFile class in combination with CArchive. But for normal c++ file i/o stuff the ofstream class is a lot easier to use. | |
Re: >>iostream.h that is for c++, not c. All the other headers are in <install directory>\include folder. In the IDE look at Options --> Directories and make sure it has the correct path. | |
Re: line 2: unless you are using a very old compiler such as the original Turbo c++ you should be using header files without the .h extension because there have been some changes. You should have named your derived string something other than String.h because that is already the name of … | |
Re: [QUOTE=VIDHYAPREM;297622]hai , just i am new member. i dn't know the forum rules.we should not answer like this or it had any mistake.please tell me.[/QUOTE] forum rules do not prohibit you from giving complete solutions, just discourages it. But you should probably take a few minutes to review the rules … | |
Re: [QUOTE=draftjoker;411740]yea, that entire paragraph was unreadable[/QUOTE] I disagree -- I may be as ancient as the hills by most people's standards here but even I was able to read/understand the post. "...tell me whatz dis" is the only sentence that I could see that might cause some problems (from non-English … | |
Re: some questions: [b]Function CreateHVFESection0().[/b] 1. Why is vpSec0 a parameter? It could just as easily be declared locally in the function since it is never used for anything. 2. Why do you bother to malloc nbytes since sizeof(size_t) is only 4 bytes in 32-bit compilers ? Just declare it normally … | |
Re: Your description sounds like a flag may not be getting set correctly. does your program contain code that is executed when it is minimizes and maximized ? Does the same problem occur with other DirectX programs written by either yourself of someone else (attempting to isolate the problem to either … | |
Re: Looks like COBOL. Don't know of any other programming languages that use that key word, but then I don't know them all either. If you have a COBOL program then it should be quite obvious from other syntex -- COBOL programs have a very distinctive grammer. | |
Re: [QUOTE=Tight_Coder_Ex;412002]You propbably want to use [inlinecode]int 21H What you are actually doing is calling interrupt 15H (21) instead of 21H.[/inlinecode] in line 10. [/quote] Good catch. I missed that too. :) [QUOTE=Tight_Coder_Ex;412002] I can't verify that AX = 4C00 is correct because my book is for DOS 2.1[/QUOTE] You could … | |
Re: depends on the operating system. MS-Windows you can use FindFirstFile() and FindNextFile(). *nix you can use opendir() and readdir(). Or boost libraries have a functions that are portable between operating systems. You can find c++ examples of both in the [URL="http://www.daniweb.com/code/coder46588.html"]c++ code snippets here at DaniWeb[/URL]. | |
Re: just write a little prgram that generates 1000 numbers between 10 and 100 using rand() % 100 + 10 to generate the numbers and save them to a file. Then you can write the other program as your teacher instructed. | |
Re: do you mean computer A controling a USB device on computers B, C, D, ... which are all connected on the same network ? The only way I can imagine that happening is if computer A sends instructions via sockets (or some other way) to a program on the other … | |
Re: >>Is there an equivalent to SendKeys.Send in C++? No. C++ language knows nothing (other than what it inherited from C language in stdio.h) about the keyboard because its os specific. You have to use os-specific api function calls to send them one character at a time like jamthwee suggested. | |
Re: Unless you are writing c++ templates don't put executable class implementation code in *.h files -- it goes in *.cpp file. | |
Re: [QUOTE=eyedea2011;410299]Can someone help im suppose to write a family of overloaded functions called equal(), which take two arguments of the same type, returning 1 if the arguments are equal, and 0 otherwise. This is what i have that refuses to compile.[/quote] What question(s) do you have about the code you … | |
Re: [QUOTE=goldpanini;411153]I think I have the same problem This thing is driving me crazy. Here's the Hijackthis log. Anyway, I'm new to this and hope someone can help as my antivirus is not removing this problem. Thanks in advance. [/quote] Did you trie Crunchie's suggestions ? | |
Re: >> for (j=1;j<=n;j++) I think you misquoted the code (lines 19 and 20) because that is just so much nonsense. Proofread the code you have to make sure you did not make typing errors. If its really like that in the book then go to the publishers web site to … | |
Re: >>And why would they when there are plenty of lap-dogs to clean up after them :angry: I resent being called a "lap dog" >>Unless you put some serious inconvenience in the way, they're just not going to learn Learn what? how to use code tags? Yes, I've given out a … | |
Re: Its pretty simple, really. Just create an array and read each line into its own element of the array. You will need a loop to read the file until eof() and an int counter to keep track of the line number read so that it will know which row to … | |
Re: [quote=Narue;364336]>Because this thread was made for anything and everything. That's why. Then I guess it's pointless to have a chat room if everyone refuses to use it.[/quote] Maybe because nobody knows its there -- this is the first I heard of it. I probably wouldn't use it anyway even if … | |
Re: sort() does in-memory sort -- what you need is a file sort program. Or better yet write a file sort-merge function and add it to your program to preprocess the file. That way you can do away with that fork pipe and exec function calls. you might check the boost … | |
Re: >>recursive implementation of depth first search [URL="http://en.wikipedia.org/wiki/Depth-first_search"]read this[/URL] >> is it possible to code any problem with recursion without using global variable yes, pass them as a function parameter | |
Re: tm struct does not contain milliseconds. But if you don't care about milliseconds then tm will work in all platforms and compilers because it is in standard C library. | |
Re: Are you blind, senile, have demeinita, or maybe older than I am? I have already told you TWICE what the problem is with that second program. And this is the third time you have posted that same code. Now, go back and re-read the responses to your previous threads. I'm … | |
Re: [URL="http://www.winprog.org/tutorial/"]Here[/URL] is a popular tutorial. win32 api is C, not C++. You can create c++ programs that call win32 api but it isn't necessary. MFC and wxWidgets are two c++ gui libraries. wxWidgets is free and works with most compilers and operating systems. MFC is not free and restricted to … | |
Re: go to [url]www.amazon.com[/url] and do search for those subjects -- entire books have been written about them so its unlikely we can do them justice here. | |
Re: >>I'm trying to write 2 codes in C++, but i'm having major problems what exactly are the [b][i]major problems[/i][/b] ? >>This is what i have so far: That's nice. Now what do you want us to do? Or what question(s) do you have? | |
Re: Every resource item must have a unique ID number, both the resource files in your project and resource files in other DLLs. You can use [URL="http://msdn2.microsoft.com/en-us/library/ms647990.aspx"]LoadMenu[/URL]() to load a menu resource that is not normally part of the project. Also read the links [URL="http://msdn2.microsoft.com/en-us/library/ms647558.aspx"]here[/URL] for how to create a shortcut … | |
Re: which line ? On line 18 the value of ptr2 is random because it is uninitialized. Line 22 is also random because it is deferencing the integer located at the address of the address, which also has not been initialized and could possibly crash the program. I don't know how … | |
Re: >>p==&i; That is a logical expression, not an assignment. Its asking if the address stored in pointer p is the same as the address of i. | |
Re: >>why is it 32 Look at any standard [URL="http://images.google.com/imgres?imgurl=http://www.ascii.ws/images/ascii-chart.gif&imgrefurl=http://www.ascii.ws/ascii-chart.html&h=488&w=715&sz=28&tbnid=bx0wgtxpR0THsM:&tbnh=96&tbnw=140&prev=/images%3Fq%3Dascii%2Bchart%26um%3D1&start=1&sa=X&oi=images&ct=image&cd=1"]ASCII chart[/URL] and you will see that the letter 'A' = 65 and 'a' = 97. 32 is the difference between them. Subtract 32 from any lower-case letter and you will get the upper-case letter. | |
Re: See [URL="http://www.freevbcode.com/ShowCode.asp?ID=3402"]this article[/URL] And [URL="http://www.google.com/search?hl=en&q=how+to+call+a+dll+from+vb"]here[/URL] are some google links you might also want to read. Looks like some of them have example code. | |
Re: why don't you just download the free DICOM viewer from[URL="http://medical.nema.org/"] here[/URL]? There's also a discussion group where you can ask them specific questions. | |
Re: In the second program you should really use islower() macro to check if the character is lower-case. Then use toupper() to convert from lower-case to upper-case, like this: [code] if( islower(str[i])) str[i] = toupper(str[i]); [/code] Otherwise, that program works ok for me. :) | |
Re: initialize the arrays like this: [code] char name1[ arraySize ] = "Kenneth"; char name2[7] = "Clifton"; char name3[] = "Suzanne"; char name4[10] = "Elizabeth"; [/code] Note that you might get buffer overflow errors -- I'll leave that up to you to fix. | |
Re: Some compilers will even let you declare main as returning a pointer! (VC++ 6.0 for example) [code] char* main() { char* ptr; return ptr; } [/code] But since pointers are really integers the program will actually return the integer value of that pointer. Meaningless -- absolutely. But I've seen someone … | |
Re: Welcome to DaniWeb Gorden. >>Where can i learn how to program depends on the language you want to start learning. Look in the Software Development boards and you will find lots of hints and links in the [b]Read Me[/b] posts at the top of each board. | |
Re: use one star for each dimension, like this: [inlinecode]int ***a;[/inlinecode] Now, in C programs, call malloc() to allocate each dimension. This will require two loops for the second and third dimensions. | |
Re: [QUOTE=TkTkorrovi;407998]int space [] is in effect the same as int *space, you can use one instead of another.[/QUOTE] Sorry, but the two are not interchangeable. [b]int space [] [/b] causes illegal syntax error message (VC++ 2005 Express compiler.). Unless that is something new in C99 standards, which very few compilers … | |
Re: Have fun and study hard. Will be expecting a report of the fun things you did during your vacation. :) | |
Re: >>i need a detail explanation how the program work I assum then that you did not write that code? If you had then you would know how it works. What part(s) do you need help with? | |
Re: >> any one can help me with code pleas Yes, start here [code] int main() { // put your code here } [/code] | |
Re: [QUOTE=The Dude;234076][url=http://tinyurl.com/fxbs3]PUT THE KEY IN??[/url] I did it 6 times then it got too hard!![/QUOTE] 4 times -- then I passed out because I thought I was drunk;) | |
Re: QT GUI library is also portable between many (but not all) operating systems. As for compilers -- you will need one for each OS that you want to support. There is no one compiler that will cross-compile for all of them. | |
Re: >> why the pointer value is allocated only 4 Bytes Not necessarily -- depends on the operating system and the compiler. In the days of 16-bit MS-DOS pointers were 2 bytes. On 64-bit MS-Windows pointers are 8 bytes. The maximum number of nodes in a linked list would be limited … |
The End.