15,300 Posted Topics

Member Avatar for techie929

>>unsigned char byte2[1]="0X"; Wrong. You tried to stuff two characters in an array that can only hold one. Something like me trying to stuff my gut into pants that are too small. You didn't say whether you are allowed to use standard C functions or not. If you are, then …

Member Avatar for strmstn
0
142
Member Avatar for TimCereja

[QUOTE=gerard4143;1165999]If this is a Linux/Unix program then you have to compile with -lcurses gcc filename.c -o filename -lcurses[/QUOTE] Why? getchar() is defined in stdio.h not curses.h. Oh wait a minute -- you were talking bout getch() which might be in curses. I don't think that's the one the op was …

Member Avatar for Ancient Dragon
0
93
Member Avatar for techie929

It depends on the contents of the file -- every binary file is different. In a nutshell, use ifstream's read() method.

Member Avatar for Ancient Dragon
0
76
Member Avatar for Excizted

Probably not. I suppose you could keep it encrypted, but even that will not prevent some smart hacker from decrypting the password. There really is no bullet-proof way to save passwords, anywhere except in the human mind.

Member Avatar for Excizted
0
163
Member Avatar for Iam3R

[QUOTE=Banfa;1164785] People just continue to use 0 rather than EXIT_SUCCESS because it is rather easier to type.[/QUOTE] Old timers like me use 0 out of habit. I started programming before c++ was invented, and even before there was such a thing as function prototype. Magic numbers were the norm in …

Member Avatar for nezachem
0
226
Member Avatar for jephthah

Aia brought up one of the reasons I recommended strtol() instead of strtok(). With strtol() you can make each of the conversions in one single line of code (one for each variable), and no loops.

Member Avatar for Dave Sinkula
0
157
Member Avatar for rpowell16

>> #include <stdio.h> Delete that line. This is c++ program, not C. When posting code put it in code tags[noparse][code] // your code goes here [/code][/noparse] so that we can read it.

Member Avatar for Banfa
0
92
Member Avatar for manoj_rashmi

use it just like you would any POD (Plain Old Data). Your question is so vague that all I can give you is a vague response.

Member Avatar for abhimanipal
0
96
Member Avatar for sandeep.shine

Your options are NOT either Dev-C++ or BUY a commercial compiler. There are several very good free compilers. Both Code::Blocks and VC++ 2008 Express are free. Dev-C++ is no longer recommended because it's pretty much dead and is installed with an old version of the MinGW compiler. If you are …

Member Avatar for Ancient Dragon
1
170
Member Avatar for TimCereja
Member Avatar for TimCereja
0
362
Member Avatar for Mahen

If you think your software is so great, you can spend a few million of your own money for packaging, advertisment, and distribution. Or, if you aren't quite that confident or wealthy, you can put it on the net as shareware.

Member Avatar for peter_budo
0
280
Member Avatar for jk_bscomp
Member Avatar for bexxy

[quote] The user enters a name and then decides he/she wants to display the name via the saved list, but once they enter the name, they cant display the entered name in the saved list straight away ...[/quote] The solution is to save the new name in the list as …

Member Avatar for Ancient Dragon
0
97
Member Avatar for vijay K

what compiler do you have? If you have Dev-C++ then you will have to download the windows package using the Dev-C++ IDE package manager. I think there is a menu item for that.

Member Avatar for Ancient Dragon
0
92
Member Avatar for team_tip

>>API should be in the form of static library. There are two kinds of libraries -- static libraries and import libraries (or dlls). When you create a new win32 project you have a choice of Windows Application, Console Application, DLL or Static Library. Choose the last one. I suppose they …

Member Avatar for Ancient Dragon
0
119
Member Avatar for LemonLemon

what do you mean you want to convert it to binary? Like the letter A (which has a decimal value of 65) = 1000001?

Member Avatar for Ancient Dragon
0
98
Member Avatar for jemscomput
Re: c++

I'll bet you are trying to run that program under MS-Windows version XP or newer? If that is true then you can not run that program on your os. Install Win98 or MS-Dos Version 6.X and try again. I know that's not what you want to hear but that's the …

Member Avatar for jwenting
0
111
Member Avatar for mrnobody

You can't assign the variant like that because _bstr_t owns the memory. [code] int main() { _bstr_t a = (L"Joe Schmoe"); _bstr_t b = (L"Accounting"); VARIANT vtEmpName; VARIANT vtDept; vtEmpName.vt = VT_BSTR; vtEmpName.bstrVal = a.Detach(); vtDept.vt = VT_BSTR; vtDept.bstrVal = b.Detach(); } [/code] you can also do it like this: …

Member Avatar for mrnobody
0
145
Member Avatar for vishalkbhatt

Read the file by line, not by character because you will need to parse the words in the file in order to find key words. So read the file using getline() instead of get(). To do #4 you will have to make an array of key c++ words. The easiest …

Member Avatar for Ancient Dragon
0
103
Member Avatar for dabboo

Did you create a console project? e.g. File --> new --> project then select Console Application in the popup box.

Member Avatar for dabboo
1
93
Member Avatar for churni

you will have to post the entire program because there is no way anyone can determine the problem from the little code you posted.

Member Avatar for churni
0
223
Member Avatar for bigt666

The code you posted has nothing to do with the problem. Try posting again but this time make sure you post the correct program.

Member Avatar for WaltP
0
227
Member Avatar for donelliewhyte
Member Avatar for donelliewhyte

while loop is incorrect. You need to read all the records, not just the first one for that doctor. BTW writing short programs to solve a specific problem save you a lot of time. [code] #include <stdio.h> #include <string.h> struct doctor { char name[80]; char regis[80]; char pname[80]; char treatment[80]; …

Member Avatar for Ancient Dragon
0
132
Member Avatar for Dudani
Member Avatar for Carrots

Do not put executable code such as lines 27-30 in header files. If you want to make that inline then put it in the class declaration the way you did getName(). You have several functions mis-coded like that. [code] class GrandParent { public: //constructor GrandParent(string name) {_name = name;} //Getter …

Member Avatar for Carrots
0
198
Member Avatar for misdemeanor01
Member Avatar for Ancient Dragon
0
22
Member Avatar for alvalany

Another reason not to use Turbo C for Windows programming -- it can not be use for that. Turbo C is a 16-bit compiler and can not access any of the 32-bit MS-Windows libraries or DLLs. I didn't realize Turbo C++ Explorer is no longer available. It must not have …

Member Avatar for Ancient Dragon
0
971
Member Avatar for clutchkiller

[QUOTE=Narue;1157134][B]> A wise man welcomes competition and betters himself, a fool stomps it out so his mediocrity shines.[/QUOTE] You should have told that to Bill Gates & Microsoft :)

Member Avatar for jwenting
-3
141
Member Avatar for Encrypted

post the whole program. In the code you posted the variable [b]hydraulicRadius[/b] was not defined. Did you include <math.h> ?

Member Avatar for MosaicFuneral
0
392
Member Avatar for Ancient Dragon

There's some rhumors over here USA tabloids that Price William, not his father, will become the next King. Any truth to that?

Member Avatar for diafol
0
242
Member Avatar for Icebone1000

The best approach is to use standard c++ file i/o classes and methods because that gives your program the best portability should you decide to port it to another operating system sometime in the future. Using win32 api file i/o functions is a little like limiting yourself to only binary …

Member Avatar for Ancient Dragon
0
257
Member Avatar for endframe

Functions can not use variables that were declared in other functions. You have two choices: pass min and max variables as parameters or make them global so that all functions can use them. Passing as parameters is the preferred way to solve the problem.

Member Avatar for endframe
0
341
Member Avatar for yogi2345

>>.what can i do replace the current version of MS_Windows with MS-DOS 6.X or Win95.

Member Avatar for Ancient Dragon
-1
64
Member Avatar for vuki27

Why don't you use the standard C function fgets()? Or are you not allowed to do that? [code] char name[10]; fgets(name, sizeof(name), stdin); if( name[strlen(name)-1] == '\n') name[strlen(name)-1] = '\0'; [/code]

Member Avatar for Narue
0
5K
Member Avatar for infrapt

>>I am trying to send the address of the ptr to another sub processor. Huh? Are you using a PC or something else? You also need to post some code if you expect anyone to help you very much. Here's my [b]guess[/b] In C language just use the address operator …

Member Avatar for nezachem
0
132
Member Avatar for mattitude

line 75: while((clock ()/CLOCKS_PER_SEC)<(hours*3600)){ That is the problem (or majority of the problem). That line is not allowing any other process to run and just hogs up all the cpu time. Depending on the operating system put either Sleep() or sleep() to allow other processes to run. A few other …

Member Avatar for jephthah
0
114
Member Avatar for Kombat

Read it one character at a time, then if it's not a space add it to a character array.

Member Avatar for WaltP
0
79
Member Avatar for Salem

I agree -- when splitting a hijacked post the mods are adding [b]hijack[/b] to the new thread's title. Makes it easy to know why the first post in the new thread might be a little confusing.

Member Avatar for ~s.o.s~
2
339
Member Avatar for James.Butcher

>>inQuiz.seekg(0);//set position to begining of file Delete that line. When the file is opened the file pointer will already be set to the beginning of the file. >>inQuiz.seekg(1 - 1, ios::cur); Why? what purpose does that serve?

Member Avatar for Ancient Dragon
0
324
Member Avatar for GSPprog
Member Avatar for Ancient Dragon
0
103
Member Avatar for GrimJack

@GrimJack: I saw something like that picture on tv once -- Oh yes, it was on Star Trek NG.

Member Avatar for Biker920
1
165
Member Avatar for kng

[QUOTE=kng;1159976]Just for the book i am applying a ton of compression techniques but lets just say for some reason we still can't be able to fit the entire structure onto main memory what would you do?[/QUOTE] you might have at least a couple choices [list=1] [*] Use a 64-bit compiler …

Member Avatar for abhimanipal
0
146
Member Avatar for Velovix

vc++ uses Forms it you create a C++/CLR project, which is Microsoft specific I think. [URL="http://winprog.org/tutorial/"]Here [/URL]is a tutorial how to create a gui from pure win32 api functions. Or you might try [URL="http://www.wxwidgets.org/"]wxWidgets[/URL]

Member Avatar for Velovix
0
211
Member Avatar for ignorantpenguin

what makes you think an int is only 16 bits? Depending on your compiler, it might, but then again it might not.

Member Avatar for Ancient Dragon
0
132
Member Avatar for strmstn

line 14 of CMain.h -- global objects can not be declared in header files because the compiler will try to create them in each *.cpp file in which the header file is included. Instead, use the [b]extern[/b] keyword in the header file then in one, and only one *.cpp file …

Member Avatar for strmstn
0
96
Member Avatar for blackrobe
Member Avatar for cwarn23

My dream computer would be a hologram that computes in the future and returns the results to the present, like in Star Trek Next Generation.

Member Avatar for Biker920
0
139
Member Avatar for josolanes

switches with multiple variables is no supported, just as you thought it might not be. But ... if you convert the rgb values into [URL="http://msdn.microsoft.com/en-us/library/dd162937%28VS.85%29.aspx"]COLORREF[/URL] value then you could use that in the switch statement.

Member Avatar for josolanes
0
1K
Member Avatar for cwarn23

Sorry for being 3 months late with this. Nice function -- a couple minor tweeks to make it run faster, but nice anyway.

Member Avatar for tetron
1
668

The End.