15,300 Posted Topics

Member Avatar for needhelpe

use a loop that counts from 1 to the number you enter, then another loop that counts backwards back down to 1. Print the loop counter.

Member Avatar for Nick Evan
0
4K
Member Avatar for pawan_sharma777

[URL="http://www.dreamincode.net/forums/topic/21309-cpp-with-odbc-open-database-connectivity/"]Here [/URL]is one of many tutorials you will find. I wouldn't exactly call ODBC "dead easy", but you only need a good grasp of C or C++ language. In order to do anything useful you will need to learn SQL (Structured Query Language). Again, there is lots of information on …

Member Avatar for pawan_sharma777
0
457
Member Avatar for pro_learner

Code::Blocks is an IDE that can be used on both MS-Windows and *nix, while Fedora is an operating system.

Member Avatar for pro_learner
0
236
Member Avatar for gretty

[code] #include <sstream> #include <string> #include <windows.h> using namespace std; string date() { SYSTEMTIME stime; GetLocalTime(&stime); char buf[40] = {0}; sprintf(buf,"%02d/%02d/%04d", stime.wDay, stime.wMonth, stime.wYear); string dt = buf; return dt; } [/code]

Member Avatar for WaltP
0
1K
Member Avatar for Ahmed Sarwat

>>ifp=fopen("in.txt","r"); That is opening the file in text mode while fread() expects binary mode. Suggest you replace fread() with fgets() if you want to keep text mode. >>fread(text[0],sizeof(char*),1,ifp); sizeof(char*) is always the sjze of a pointer, which on MS-Windows and *nix 32-bit compilers is 4. And that's why fread() is …

Member Avatar for Ahmed Sarwat
0
112
Member Avatar for gerard4143

I have never found a need to copy the vtable in any of my c++ programs. I normally use Microsoft compilers and have never encountered a vtable problem with them. If you use a compiler that has such a problem then get yourself a different compiler.

Member Avatar for gerard4143
0
219
Member Avatar for gisek

When you start the program it sets the current working dirfectory to the folder which clontains the source files. So if you put that file in the debug folder then you copied it to the wrong folder. Put the file in the same folder as the *.c and *.cpp files.

Member Avatar for gisek
0
264
Member Avatar for tikoti

>>When is not going to be available a shell? Some embedded systems don't have a shell. I have not used all operatin gsystems so I suppose there could be a few others out there too that don't have shells. MS-Windows and *nix will always have one available. Instead of testing …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for MysticMan3000

Your question is a little fuzzy -- what kind of object do you want to create when the time is entered? Are you talking about a clock?

Member Avatar for jonsca
0
149
Member Avatar for musikluver4

If you ask really really nice you might ask one of the mods to remove the code you posted, leaving the rest of the post.

Member Avatar for Dani
0
187
Member Avatar for amit_tare1
Member Avatar for seanbp
-1
149
Member Avatar for sdinu96

use ifstream. Assuming status is a file and not a directory it would be like this [code] #include <fstreeam> using std::ifstream; int main() { ifstream in("./proc/1/status"); } [/code]

Member Avatar for Ancient Dragon
0
66
Member Avatar for asifakram

take the program you have and strip out all the calls to graphics.h functions and what is left is what you probably want to incorporate into your VC++ program. My guess is that there is other code in that program to support the graphics functions which you will not need …

Member Avatar for Bilal Anwar
0
272
Member Avatar for lucdatuv

People who break the laws are more than just "disobediant" -- they are criminals. Just because you don't like a law doesn't give you the right to disobey it. Are there laws that shouldn't exist -- Yes, but the way to get around it is to change the law, not …

Member Avatar for MooGeek
-6
342
Member Avatar for barryt

>>if no one answers my thread i cannot get to it again See that purple ribbon at the bottom of the screen? It contains several links -- one of them is "Threads I've Posted In" and another "Threads I've Started". Just click "Threads I've Started" and DaniWeb will show you …

Member Avatar for happygeek
0
221
Member Avatar for kiel19

>>i have no idea on how to go about it, start here. Now fill in the function shown below with your program requirements. Do only one little part at a time, compile and correct all errors. Then do a little more and repeat until all requirements have been fulfilled. Example …

Member Avatar for WaltP
0
3K
Member Avatar for cmaheshwari16

After getting the date and number of days, use functions/structures in time.h to do all the hard work. First populate a struct tm with the year,month and day from keyboard input, then add in the number of days to mdays field of the structure. Finally call mktime() and it will …

Member Avatar for sharathg.satya
0
8K
Member Avatar for bigwhiteegg

what is %2 supposed to mean? Or do you just want to print %2 on the console screen? If yes, then just use int 21 instructions to do that, assuming you are using Intel or compatible processor.

Member Avatar for Goalatio
0
89
Member Avatar for Colin Mac

>>Why does it jump back to the turbo c window when I press enter to enter my age? Is this wrong? because you didn't tell the program to do anything else. If you want it to wait so that you can see what's on the screen, put a getch() at …

Member Avatar for Shankye
1
284
Member Avatar for shakssage

If your program is calling OpenFileDialog() then you need to set the RestoreDirectory property to TRUE so that it does not change the current working directory on you.

Member Avatar for shakssage
0
237
Member Avatar for fettucine1

>>Our professor ask us to upload our program in a website, I've been searching through the web with possible ways, but I still can't figure it out how to do it. Whose web site? The professors? The web site should have a link to upload files to it. If you …

Member Avatar for Ancient Dragon
0
229
Member Avatar for shinsengumi

Check the compiler output screen to see if it recognizes thse pragmas. I know those functions are in ws2_32.lib. Its possible the pragmas were ignored.

Member Avatar for shinsengumi
0
899
Member Avatar for Dani

I see another new stat too -- number of activity points. I have never noticed that before, and assume it's reset to 0 each day. Might be interesting to have a link that would show a graph of total activity points for each day over the past month or so. …

Member Avatar for peter_budo
3
675
Member Avatar for Tellalca

you are using the same fstream object to do both reading and writing. That is ok, but you have to call seekg() between the two in order to reset the file pointer back to the beginning of the int that was written. [edit]Or use ifstream and ofstream as ^^^ suggested.

Member Avatar for Tellalca
0
158
Member Avatar for elsiekins

[URL="http://www.daweidesigns.com/cgi-bin/pointers.php"]Here [/URL]is a pointer tutorial from DaWei

Member Avatar for Ancient Dragon
0
130
Member Avatar for MairiRobertson

On MS-Windows I use either VC++ 2010 Express or Code::Blocks. On *nix (rarely) I use Code::Blocks. Never had a reason to use Eclipse. In the early years of programming (1980s and 1990s) I used a text editor, something like Notepad or VI and compiled everything from the command line using …

Member Avatar for mike_2000_17
0
163
Member Avatar for yuri1969

You can use / in both MS-Windows and *nix. C:/foo/bar.dat If you still want to use \, then the only time you need \\ is in string literals which are surrounded by quotes. Paths read from a file or returned by some other function do not need \\.

Member Avatar for yuri1969
0
157
Member Avatar for gouzou
Member Avatar for Ancient Dragon
-1
81
Member Avatar for vedro-compota

The reason is that there are only a limited finite number of resigers available to the program. For example on Intel and compatible processors there are only 6 register variables in common use throught the program (eax,ebx,ecx,edx,esi and edi), so it would be impossible to store global variables in them.

Member Avatar for vedro-compota
0
159
Member Avatar for shakssage
Member Avatar for jonsca
0
433
Member Avatar for deanus

Its crashing when extend() is called from the class constructor because you failed to initiailze class variables before calling that function. Line 65 is trying to delete an ininitialized pointer. That is bad regardless of what compiler you used.

Member Avatar for deanus
0
143
Member Avatar for shinsengumi

Hopefully you will not need to make very many changes to the source code. MS-Windows uses winsock instead of berkley sockets, so you might want to skim through [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS397&=&q=winsock+tutorial&aq=0&oq=winsock+tutor"]one of the tutorials[/URL] to see what changes you may need to make. As for MySql, I don't think you will have …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for ~s.o.s~

[QUOTE=~s.o.s~;289626] If yes then what did marriage change in your life, are the new found responsibilities burdening you or making you a better person ? Regards, ~s.o.s~ PS: I am single and for me marriage is a sacred relationship...[/QUOTE] I have been married (to the same woman) 43 years next …

Member Avatar for Borzoi
0
726
Member Avatar for Smokehouse69

An easy way to find out if the problem is your new program is to run it from the command prompt and redirect the output to a file, such as [icode]c:\myprogram >myfile[/icode] After the program finishes check the contents of the file to see if it contains the data you …

Member Avatar for Smokehouse69
0
203
Member Avatar for newsguy

Even the title of this article is obnoxious-- a "wet dream" is what teenage boys experience. So are you trying to say that male programmers will ejeculate at the thought of iPhone 3.0?

Member Avatar for Appspy
0
234
Member Avatar for svatstika

Such a class would keep all the digits as a vector, array or linked list of characters, and you could make it so that it has no upper or lower limit to the number of digits it can hold. >>May you get me started? Certainly -- here goes [code] #include …

Member Avatar for Ancient Dragon
0
93
Member Avatar for CanofCornInfini

You can not open the same file twice. Use just one FILE* pointer and open it for both reading and writing if you need to.

Member Avatar for Shankye
0
541
Member Avatar for qazplm114477

Apparently the design works -- everyone is talking about it aren't they :) :)

Member Avatar for cwekeybb2351
0
666
Member Avatar for benqus

You could write it with c++ and use QT, which is a cross-platform GUI compiler.

Member Avatar for benqus
0
220
Member Avatar for atramposch

Have you studied structures and linked lists yet? If you know structures, then create a structure that contains two items: the double value and an int count of the number of times the value occurs in the original list. Then make an array or linked list of that structure. You …

Member Avatar for Adak
0
109
Member Avatar for Jeddahforever

There are a couple of ways to delete a book from the library. 1. Rewrite the entire file, and omit the book that is to be deleted. 2. Mark the book to be deleted so that other functions just simply skip it when reading the file. One way to mark …

Member Avatar for Ancient Dragon
0
126
Member Avatar for alaa sam
Member Avatar for Ancient Dragon
0
66
Member Avatar for ShawnCplus

>>What do you guys/gals think I hate it because it does nothing more than obfuscate the program. Maintainability and readability are more important than cuteness.

Member Avatar for arkoenig
0
232
Member Avatar for bflack

You have to use strcpy() to copy character arrays -- assignment operator doesn't work. [icode]strcpy(temp_last,record[j+1].last_name); [/icode]

Member Avatar for Shankye
0
193
Member Avatar for mikesr

int instructions only work for the interrupt functions that are pre-defined by the operating system. printf() and scanf() are not define by the os api therefore it's not possible to perform int instructions to access them. Those are higher-level functions defined by the C language. google for int 21 instructions …

Member Avatar for Tight_Coder_Ex
0
870
Member Avatar for Anuradha Mandal

You most likely have a project that contains two or more *.cpp files, and two of the files have main() defined in them. Delete the one you don't want.

Member Avatar for Ancient Dragon
0
191
Member Avatar for Mushida
Member Avatar for Mushida
0
202
Member Avatar for juliemac
Member Avatar for kapilsolanki84

[URL="http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855"]Tutorial[/URL]

Member Avatar for Ancient Dragon
0
1K
Member Avatar for foliot

pixelmap::pixels is NOT a multi-dimensional array -- it's a single dimentional array. You have to add one star for each dimension. For example, for a 2 dimension array you declare it as [icode]pixel** pixels;[/icode] Then allocate it like this: [code] this>pixels = new pixels*[height]; for(int i = 0; i < …

Member Avatar for StuXYZ
0
194

The End.