15,300 Posted Topics

Member Avatar for xponse

[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

Member Avatar for ~s.o.s~
2
458
Member Avatar for shaynerossum

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 …

Member Avatar for shaynerossum
0
160
Member Avatar for norulez43

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

Member Avatar for ArkM
0
161
Member Avatar for wakeboarder1335

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 …

Member Avatar for Ancient Dragon
0
91
Member Avatar for vddmanikanta

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.

Member Avatar for Ancient Dragon
0
441
Member Avatar for oah1837

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

Member Avatar for Ancient Dragon
0
81
Member Avatar for daviddoria

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

Member Avatar for Ancient Dragon
0
87
Member Avatar for eriksank

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.

Member Avatar for Ancient Dragon
0
132
Member Avatar for kenji

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

Member Avatar for Ancient Dragon
0
299
Member Avatar for toolmanx

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() …

Member Avatar for MrSpigot
0
1K
Member Avatar for kailisr

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

Member Avatar for WaltP
0
146
Member Avatar for mathueie

[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)

Member Avatar for Ancient Dragon
0
100
Member Avatar for NicAx64

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 …

Member Avatar for NicAx64
0
309
Member Avatar for luvsom

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

Member Avatar for WaltP
0
129
Member Avatar for denis1401

[URL="http://msdn.microsoft.com/en-us/library/ms997537.aspx"]windows hooks[/URL]

Member Avatar for MosaicFuneral
0
83
Member Avatar for Liszt

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.

Member Avatar for Liszt
0
104
Member Avatar for waehake
Member Avatar for NathanOliver
0
115
Member Avatar for NathanOliver

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++) …

Member Avatar for NathanOliver
0
89
Member Avatar for ganmo

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

Member Avatar for ganmo
0
114
Member Avatar for VernonDozier

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

Member Avatar for sneekula
2
485
Member Avatar for Duki
Member Avatar for vmanes
0
153
Member Avatar for Mem21

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.

Member Avatar for siddhant3s
0
111
Member Avatar for abhishek2301

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 …

Member Avatar for Ancient Dragon
0
166
Member Avatar for 3beer

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

Member Avatar for Ancient Dragon
0
116
Member Avatar for lijojoy_hai

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 …

Member Avatar for Ancient Dragon
0
113
Member Avatar for Ancient Dragon

[URL="http://www.metacafe.com/watch/156580/50_000_rock_paper_scissors/"]Rock Paper Scissors Championship[/URL]

Member Avatar for GrimJack
0
114
Member Avatar for BlackStar

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.

Member Avatar for BlackStar
0
414
Member Avatar for tux4life

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

Member Avatar for Ancient Dragon
0
217
Member Avatar for gryft

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]

Member Avatar for tux4life
0
165
Member Avatar for Ancient Dragon

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]

Member Avatar for almostbob
0
129
Member Avatar for cskumar

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); // …

Member Avatar for Ancient Dragon
0
90
Member Avatar for SCoder1

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 …

Member Avatar for SCoder1
0
76
Member Avatar for ulisse0

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 …

Member Avatar for tux4life
0
163
Member Avatar for fadia

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 ?

Member Avatar for fadia
0
164
Member Avatar for nanchuangyeyu

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; } // …

Member Avatar for nanchuangyeyu
0
130
Member Avatar for newcpp

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.

Member Avatar for Ancient Dragon
0
367
Member Avatar for cam875

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

Member Avatar for cam875
0
87
Member Avatar for BlackStar
Member Avatar for BlackStar
0
320
Member Avatar for ni30rocks

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 …

Member Avatar for ArkM
0
85
Member Avatar for Bladtman242

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

Member Avatar for Bladtman242
0
145
Member Avatar for serkan sendur

If this turns into another "I love you Dani" thread, I swear I will ban you! (not really, but I'd like to).

Member Avatar for ~s.o.s~
0
318
Member Avatar for Clawsy

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 …

Member Avatar for Clawsy
0
350
Member Avatar for Jacky1
Member Avatar for William Hemsworth
0
232
Member Avatar for Lukezzz

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 …

Member Avatar for landonr
0
278
Member Avatar for daviddoria
Member Avatar for Ancient Dragon
0
294
Member Avatar for lllllIllIlllI

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 …

Member Avatar for lllllIllIlllI
0
346
Member Avatar for therealsolitare

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 …

Member Avatar for Salem
0
6K
Member Avatar for Lukezzz

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]

Member Avatar for ArkM
0
103
Member Avatar for fadia

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.

Member Avatar for fadia
0
163
Member Avatar for ShadowScripter

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.

Member Avatar for Ancient Dragon
0
268

The End.