15,300 Posted Topics
Re: [QUOTE=sudhi_lv;432655]webcourse.cs.technion.ac.il/234112/Winter2004-2005/en/ho_Download%20Turbo-C.html -[/QUOTE] Your link is just a tad late isn't it (by a year or so) ? :-O | |
Re: the function does not need double star pointers (pointers to pointers). Therefore this line will not work right [icode]for(x=0;catftw[x]!=0;x++);[/icode] >>lawl[x] = catftw[x]; //gives error when catftw properly initialized As Gomer Pyle would have said: "Surprise, surprise surprise". lawl is a double star pointer and that line is treating it as … | |
Re: [URL="http://www.bizcode.com/msoffice.htm"]Read this article[/URL]. You will probably want to write the code with VB Automation. and an[URL="http://www.xtremevbtalk.com/showthread.php?t=160459"] FAQ[/URL] | |
Re: After connecting to the server there is probably some sort of communication protocol strings the client has to pass to the server in order for the server to authenticate it. What strings that is will depend on the server. You will have to read the server's documentation to find out … | |
Re: I don't know about gcc, but Microsoft compilers have an [URL="http://msdn.microsoft.com/en-us/library/chh3fb0k(VS.80).aspx"]optimize pragma.[/URL]. You might check of gcc has similar pragma. There is no similar pragma for _root that works on individual variables. You might also try the [URL="http://msdn.microsoft.com/en-us/library/12a04hfd(VS.80).aspx"]volatile[/URL] keyword. | |
Re: >> if(strcmp(user,username)==0) That is a case-sensitive comparison, so "John" is not the same as "john" due to capitalization. Depending on your compiler, use stricmp(), comparenocase(), or convert both strings to either upper or lower case before calling strcmp(). | |
Re: >>Is there a way to define the < operator for Object somehow such that I can do this without having to modify Tools? Of course there is. That's how std::sort function does it -- one of the arguments to std::sort is a user-defined function pointer, which sort() calls to determine … | |
Re: Welcome to DaniWeb. Hope you find what you want. Please post that sort of info in Business Exchange forums. This one is for introductions only. | |
Re: The most common reason for those duplicate declaration errors is declaring variables in header files without the [b]extern[/b] keyword. extern tells the compiler that the object is actually declared in some other *.cpp or *.c file. Here is an example of how you must declare variables in header files [code] … | |
Re: Hint: If the code in the timer proc TimerProc() takes more time to execute than the amount of time specified in the SetTimer() function call (1 second) then TimerProc() needs to kill the timer and restart it before leaving. Don't leave the timer running or the os will call TimerProc() … | |
Re: >>temp2 = 1+ RaceBonus / 100%; what is that 100% ? The % in C++ (and C) is the mod operator, which is the remainder after division. So % doesn't make any sense there. Or is that supposed to be 100 percent? | |
Re: [QUOTE=mathueie;863878]Hi, I am using ubuntu linux. GetProcessTimes(), GetThreadTimes(), GetSystemTimes() are windows API[/QUOTE] So, install Windows Vista :) (I really have no clue, just wanted to post a smartass remark) | |
Re: There are the definitions of those two words -- non-native English speakers may not realize the difference between the two words. [quote]Envy (also called invidiousness) may be defined as an emotion that "occurs when a person lacks another’s [perceived] superior quality, achievement, or possession and either desires it or wishes … | |
Re: >>num = number / (10^n-1); you have to use pow() function [icode]num number / pow(10,n)-1;[/icode] The problem with that is if pow() returns 1 then the formula will get a divide by 0 error. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/ms997537.aspx"]windows hooks[/URL] | |
Re: If its the source code you want to protect, then the best you can do is put a copyright notice at the top of the software, then when you find someone who has stolen it you can sue him for copyright infringement. But lawyer fees might make that impractical. | |
Re: >>to start off thanks for the help in advance, You forgot to ask question(s) | |
Re: I don't know about faster, but here is another way that only requires a single function. This function only writes to the screen, not to a file. [code] #include <string> #include <ctime> using namespace std; void Passwords(int size) { std::string pwd; pwd.resize(size); for(int i = 0; i < 128; i++) … | |
Re: There are several ways to solve your problem. 1) add a pure virtual print method to the base class which must be implemented by the derived classes. Then all the program has to do is call the base class method, and the correct derived class's implementation code will get processed. … | |
Re: [quote]The U.S. Census Bureau statistics tell us that there are at least 88,799 different last names and 5,163 different first names in common use in the United States. Some names are more common than others. There are 50,582 people named John Smith in the United States. There are 1,070 people … | |
Re: line 73 writes out the number of array elements. So line 86 has to read it. | |
Re: line 1: create an ifstream object to read from a file. line 2: Opens a file for reading line 3: declares a character array of BUFLEN number of bytes. line 4: sounds the internal computer speaker, assuming it has one. | |
Re: Put only function prototypes and [b]extern[/b] object declarations in header files, such as [code] // A.h file extern void foo(); extern int f1; [/code] Now, in one and only one *.cpp file you have to declare the same without the [b]extern[/b] keyword. [code] // A.cpp file #include "A.h" int f1 … | |
Re: Where in that line does GPA appear? After reading the line from the file, move gpa to the beginning of the line to make sorting faster and easier. You could also copy gpa into a different array to make sorting much faster. [code] struct line { char gpa[5]; char ln[80]; … | |
Re: Welcome to DaniWeb. [QUOTE=lijojoy_hai;862138]Hi, How to get all session in an application which is login by different users....[/QUOTE] That makes absolutely no sense to me. If you are not a native English speaker, then use Notepad to write out your question in your language then use a translator to translate … | |
[URL="http://www.metacafe.com/watch/156580/50_000_rock_paper_scissors/"]Rock Paper Scissors Championship[/URL] | |
Re: The second. The first will cause a memory leek. Although in the code you posted you don't need [icode]Head = NULL;[/icode] because it just changes that pointer to whatever is returned by new. | |
Re: [QUOTE=tux4life;862644]But my C++ Book says so, by the way, why are we otherwise checking whether an assignment has failed or not using [ICODE]if(ptr == NULL)[/ICODE] ?[/QUOTE] You misunderstood your book. Better read it again. Maybe the book is talking about [b][URL="http://en.wikipedia.org/wiki/Smart_pointer"]smart pointers[/URL][/b] | |
Re: that loop is backwards [code] while( getline( fin, s) ) { found=str.find_first_of(".,?;!"); // That might find a sentence, but does not mean its the entire // sentence -- part of the sentence may have been on the previous // line -- like this comment. } [/code] | |
Currently, code=lang inserts line numbers starting at line #1. Is there a way to make it start with another number? For example [noparse][code=cplusplus line=500][/noparse] | |
Re: The way I did it was create a new filename every time I wanted to open the file. That way when the date changes my algorithm will automatically pick up the new date. [code] time_t now = time(0); struct tm* tm = localtime(&now); char filename[255]; sprintf(filename,"%04d%02d%02d", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday); // … | |
Re: I have run your program several times and don't see a problem other than you need to put a space between the first and last names when you print them on the screen. If you don't want to have to type your name every time you run the program then … | |
Re: If this is c++ why don't you just use fstream instead of FILE*. >> fprintf(out, FindData.cFileName); >> fputc('\n', out); why not just this: [icode]fprintf(out, "%s\n", FindData.cFileName);[/icode] >>I have to press Ignore in a block damage error messagebox everytime I tun it What? I have no idea what you are talking … | |
Re: You are going to have to clarify your request quite a bit more. There are trillions of ways to write functions, so what exactly has your instructor asked you to do ? | |
Re: Try this: [code] #include <cmath> #include <string> #include <iostream> #include <sstream> #include <fstream> using namespace std; class mVect { private: // NO PRIVATE DATA public: double i, j, k; mVect(); mVect(double,double); mVect(double,double,double); void print(); // NEEDS EXTRA LIBRARIES }; // INITIALIZE EMPTY VECTOR mVect::mVect() { i=0; j=0; k=0; } // … | |
Re: I see one problem -- line 61 default constructor does not allocate any memory for GridUnit so when the class is destroyed it will try to deallocate an unallocated pointer. If you don't want the class to allocate memory then set [icode]gunit = 0;[/icode] and all will be well. | |
Re: Not sure I quite understand. Let's say the file contains "ABCEFGH". Now seek to there the 'E' appears and write "KLM". What result do you want 1) ABCKLMH 2) ABCKLMEFGH 3) something else | |
Re: [code] cout << "Enter item\n"; cin >> node->item; [/code] | |
Re: Google search for ODBC, which is the oldest and most widely used way to access databases from almost any programming language. You will also find ODBC tutorials in C language. It would be a little easier to do it in C++, but that's beside the point since you specifically want … | |
Re: [QUOTE=Bladtman242;858770]Does curl involve WinApi (like i believe winsock does, or at least it seems that way) ?[/quote] Probably, but its transparent to us programmers because its cross-platform. It uses the api from whatever platform we want to use it on. [QUOTE=Bladtman242;858770]I am having huge trouble finding my way around the … | |
Re: If this turns into another "I love you Dani" thread, I swear I will ban you! (not really, but I'd like to). | |
Re: Which edition of 2008 are you using (Express, Pro, etc) ? I have the Express version, downloaded the SDK Aug 2008, set up the directory paths, compiled and linked a sample program, and all went without a problem. Before trying to write your own problem compile one of the samples … | |
Re: [URL="http://lmgtfy.com/?q=c%2B%2B+send+email"]This might help[/URL] | |
Re: You have to completely rewrite the file. [code] open original file for reading open temp file for writing while not end-of-input-file read a line from input file if this is the line to be replaced write new line to output file otherwise write the line to the output file end … | |
Re: >>Test T(1).setB(4); Should be [code] Test T(1); T.setB(4); [/code] | |
Re: I've been getting wierd behavior in c++ forum too. Sometimes code tags works and sometimes it doesn't. I toggle pain text and sometimes get a blank window, close the thread, reopen it and it might work the next time. That's why I started that other thread here. Next time it … | |
Re: VC++ 2005 Express can produce the assembly code for you but it won't produce assembly code for the standard c and c++ library functions that your program calls. Unless your teacher lets you link with standard C or C++ libraries, which I doubt, you wil have to write those functions … | |
Re: The standard way to do it is to use the time functions in time.h [code] #include <ctime> int main() { time_t now = time(0); char* stime = asctime( localtime(&now) ); cout << stime << "\n"; } [/code] | |
Re: If you mean "will you write it for me", the answer is no. If that's not what you mean then please explain in more detail why you can not write the assignment. | |
Re: you need to add additional libraries as shown in the thumbnail. Of course you would have found that too had you bothered to compile one of the sample programs that comes with DirectX SDK. |
The End.