15,300 Posted Topics

Member Avatar for kings_mitra

What do you consider an old thread? One hour, a day, month, year? Seems to me it would be better just to close them, but that topic has been discussed here before.

Member Avatar for ~s.o.s~
0
311
Member Avatar for arsenal_fan

"aligned" is the key word -- what alignment? Not all compilers use the same alignment factor, and some compilers have options to change the alignment. Microsoft compilers have a #pack paragma what lets you align different parts of the program with different alignment factors.

Member Avatar for arsenal_fan
0
251
Member Avatar for pawan_sharma777

You posted the assignment, now tell us what question you have ??? >>int fnGenerateTelNumber(char cTelephone_Num) That only declares a single character, not an array of characters. You have to declare it like this: [icode]int fnGenerateTelNumber(char cTelephone_Num[])[/icode] or any of its other variants: int fnGenerateTelNumber(char* cTelephone_Num) int fnGenerateTelNumber(char cTelephone_Num[7]) When you …

Member Avatar for Ancient Dragon
0
211
Member Avatar for SHENGTON

The problem is that the array is local to each function. The array in the input() function is destroyed as soon as input() exits. And the array in the display() function contains just random values because it is not the same array as that declared in the input() function. What …

Member Avatar for Ancient Dragon
0
328
Member Avatar for poornimashobana

>>i get floating point error:abnormal termination in my console screen Must be some other problem in your program because the code you posted should not give you that error. Post the entire program so that we can see what you did.

Member Avatar for poornimashobana
0
72
Member Avatar for markchicobaby

Most companies require an [URL="http://www.irs.gov/businesses/small/article/0,,id=98350,00.html"]Employer ID Number[/URL] mainly for tax purposes. States and local governments also have uses for that number.

Member Avatar for Ancient Dragon
0
697
Member Avatar for adi.shoukat

you can not test for EOF when working with binary files because that may be a valid character in the file. What I would do is read/write with blocks of data, using fread() and fwrite() [code] unsigned char buf[255]; size_t size; while( (size = fread(buf, 1, sizeof(buf), fp) ) > …

Member Avatar for Adak
0
2K
Member Avatar for ChaseRLewis

It was designed that way -- cin is a carry-over from C's getchar() and related functions, which behave the same way. There are no standard functions in either C or C++ that return to the program immediately when a key is pressed. If you want that behavior then you have …

Member Avatar for mike_2000_17
0
88
Member Avatar for yap.nice

"hard" is a relative term -- if you're a snot nosed brat who'se mommy always did things for you, then yes c++ might be hard to learn. Learning something takes more time for some people than for others, but stick to it an it will sink into your brain.

Member Avatar for akilank
0
159
Member Avatar for ice_cool

1) functions have to be declared before they can be called. You need to add function prototypes before the main() function. For example: [icode]void readTemp(int kelvinNumber);[/icode] now do the same thing with all the other functions. 2) There is no reason for main() to delare the two variables on lines …

Member Avatar for ice_cool
0
167
Member Avatar for Lusiphur

For MS-Windows GUI then [url]www.codeproject.com[/url] is a wealth of free code, libraries, DLLs and tutorials. Probably the largest repositories of code on the net.

Member Avatar for mike_2000_17
0
372
Member Avatar for binarydisco
Member Avatar for SamY
0
84
Member Avatar for emcyroyale

You have to enter a character 'A', 'B', or 'C'. To convert that into a numerical integer 0, 1, or 2 you just have to subtract 65 because the decimal value of the characr 'A' is 65. Look up [URL="http://www.asciitable.com/"]google for "ascii chart" [/URL]and you will see the decimal values …

Member Avatar for Ancient Dragon
0
168
Member Avatar for johndoe444

There is an old saying -- "garbage in, garbage out". What you posted is not even C code. I don't know what it is, but he certainly isn't C or C++ languages.

Member Avatar for gerard4143
0
126
Member Avatar for christofur

If it works on a PC in US and Canada, why wouldn't it work on a PC in UK?

Member Avatar for Lusiphur
0
157
Member Avatar for crapgarden

5.2: Every c++ statement ends with a semicolon. Commas are only used to separate multiple statement on a line. For example: [code] int a; int b; a = 0; b = 1; [/code] The above could also be written like below. Which one to use is up to you -- …

Member Avatar for Ancient Dragon
0
237
Member Avatar for oldbamaguy

scanf() expects the argument to be a pointer, and you passed just a float. Add the & to make num1 a pointer, like this: [icode]scanf("%f", &num1);[/icode]

Member Avatar for oieronle
0
98
Member Avatar for crapgarden

#1: The use of variable i is not the problem. The problem is that you failed to use { and } to surround multi-line if statement [code] for (int i = 0; i < gameLibrary.size(); ++i) { counter = i; cout << counter << "-"; cout << gameLibrary[i] << endl; …

Member Avatar for mrnutty
0
338
Member Avatar for johndoe444

>>And the code was working as expected. This is very funny. I am not how the hell this was working. What compiler are you using? Most recent compilers will produce either an error or a warning because of that omission. If you ignored that warning, then shame on you ;)

Member Avatar for gusano79
0
103
Member Avatar for kandarpa

My guess is that the difference is due to running the program on a multi-threaded operating system such as *nix and MS-Windows. The operating system is doing a lot more things than just running your program.

Member Avatar for kandarpa
0
94
Member Avatar for dsrepublic

1. The parantheses means type casting -- converting one type of pointer into another. You will see that syntax quite often in C programs. One way to easily find out how things work or don't work is to try it in a very small program. If you omit the parentheses …

Member Avatar for Ancient Dragon
0
120
Member Avatar for shankarz

runtime error: an error that occurs then your program is run such as division by 0, buffer overruns and corrupt stack. There are an infinite (or nearly infinite) number of these errors so its not possible to list them all. compile time error: errors that your compiler produces when it …

Member Avatar for Ancient Dragon
0
78
Member Avatar for mhm_ra

I guess you expect everyone to be mind readers. You will have to post your code

Member Avatar for peter_budo
0
202
Member Avatar for yatender123

@yatender123: Its not likely you will get anyone to do that for free. Post in Paid Job Offers forum and offer some reasonable $$$ (money)

Member Avatar for Ancient Dragon
-1
37
Member Avatar for War_Archer

What operating system? fork() is not supported on MS-Windows and your school computer is probably running *nix.

Member Avatar for War_Archer
0
2K
Member Avatar for abhijeet kamble

To change the time on your computer is operating system dependent. If you have a modern computer then you will have to use a modern compiler so that it can access os api functions. On MS-Windows you will use [URL="http://msdn.microsoft.com/en-us/library/ms724942(VS.85).aspx"]SetSystemTimer()[/URL] As for the batch files, call system() function.

Member Avatar for Ancient Dragon
0
164
Member Avatar for coolblazer

Use your compiler's debugger and step through the program to see what it is or is not doing. Then tell us what function(s) has the problem. I, for one, am not about to read all that code and debug it for you.

Member Avatar for coolblazer
0
174
Member Avatar for crapgarden

>>Does this mean that int and char are not objects? Yes -- they are not objects. They are data types. A string is not an object either. It is a c++ class that is defined in <string> header file. Objects are an intstance of a data type or c++ class …

Member Avatar for crapgarden
0
231
Member Avatar for larkson

Keep the blacklist in a vector of strings, then use a loop to compare the name entered by the user to each of the names in the blacklist. [icode]vector<string> blacklist;[/icode] If you want to ignore case, then convert all names to either upper or lower case, whichever you want, so …

Member Avatar for mrnutty
0
187
Member Avatar for hg_fs2002

I think you should be counting the number of paragraphs and the number of lines in each paragraph at the same time so that the program only reads the file one time. Just increment a line counter each time getline() is called. Use a structure to hold both the pragraph …

Member Avatar for vijayan121
0
96
Member Avatar for bilalb1

Yes, call opendir() the readdir(). A complete workable example program is in the [URL="http://www.daniweb.com/code/coder46588.html"]Code Snippets[/URL] >>i am using just a few functions of c++ That makes it a c++ program, not a c program.

Member Avatar for Ancient Dragon
0
553
Member Avatar for crapgarden

>>Does it matter which one? No. You can use either, but integers are most common. If you use char then the compiler will have to take the time to promote it to an integer before its used as the index into the array. So you can speed up a program …

Member Avatar for Fbody
0
122
Member Avatar for The Founder
Member Avatar for csmgsarma

The compiler doesn't really put all the memory for objects in uninitialized global variable data space, only enough of the memory so tht the linker can resolve all addresses. The memory for them is allocated then the program is loaded into RAM. The compiler can't do that if you initialize …

Member Avatar for gerard4143
0
1K
Member Avatar for help1

Actually not. I installed Ubantu and I had to install g++ separately. So I suppose some distributions may install g++ by default while otheres do not.

Member Avatar for daviddoria
-2
87
Member Avatar for interist
Member Avatar for suvind

They are identicdal in terms of speed and memory consumption. You can always substitute a while loop for a [b]for[/b] loop, but not the other way around. The for loop is preferable when you know exactly how many loop iterations there will be. The while loop may be necessary when …

Member Avatar for Dervish1
0
2K
Member Avatar for NubKnacker

schools should get their accrediations yanked and teachers fired for teaching such ancient compilers. There are much better free compilers such as Dev-C++. I'll bet MIT doesn't teach astrologers how to compute the distance of a star with a slide ruler and I know for a fact that NASA doesn't …

Member Avatar for jemy
0
342
Member Avatar for jackmaverick1

You need to read a tutorial about win32 api programming. [URL="http://winprog.org/tutorial/"]Here [/URL]is a very popular one. Do all the exercises in that tutorial and then you will understand the code you posted.

Member Avatar for jackmaverick1
0
200
Member Avatar for fussballer

make sure you include stdio.h and that you add main() function. The code in your link is not a complete program.

Member Avatar for fussballer
0
530
Member Avatar for vinotharan

You need to start learning ODBC in C from a tutorial. Lots of them on the net, including [URL="http://www.easysoft.com/developer/languages/c/odbc_tutorial.html"]this one[/URL]. Its a lot more difficult than what you knew in VB, so be patient and study the tutorial. There are a few c++ wrapper classes to make it a little …

Member Avatar for tesuji
0
336
Member Avatar for wwefriend
Member Avatar for rapids79

You can not use printf() in a MS-Windows gui program. Why? because there is no console. >>have tried passing the name of the array to the function but I looked around and found youd could pass only string to the function MessageBox parameters are character arrays, not c++ strings. There …

Member Avatar for Ancient Dragon
0
144
Member Avatar for ssuss

Post your teacher's email address and the course number of the class you are taking so that we can e-mail the program to him/her.

Member Avatar for steventaal
-3
179
Member Avatar for Lusiphur

>>I've been addicted to postahol for going on 15 days now with no end in sight Yooo. I've been addicted to DaniWeb for over five years now. And my post count shows that I too am a postaholic. AFAIK there is no cure for it except for death.

Member Avatar for DavidB
0
176
Member Avatar for ika_fantasy00

One way would be to make an array of valid strings then loop through that array [code] string valid[] = {"abc111","abc112","abc1113", ... }; bool ok = false; for(int i = 0; i < sizeof(valid)/sizeof(valid[0]); i++) { if( userdata == valid[i]) { ok = true; break; } } if( ok == …

Member Avatar for ika_fantasy00
0
198
Member Avatar for cwarn23

6 hours? OMG next time use google! [URL="http://msdn.microsoft.com/en-us/library/ms235631(VS.80).aspx"]Here [/URL]is how to do it. [code] wchar_t wname[255]; std::string name = "John"; size_t convertedChars = 0; mbstowcs_s(&convertedChars, wname, sizeof(wname)/sizeof(wname[0]), name.c_str(), _TRUNCATE); IGUIEditBox* player = env->addEditBox(wname, rect<s32>(170, 80, 320, 100)); [/code]

Member Avatar for cwarn23
0
119
Member Avatar for Kanoisa
Member Avatar for suvind

[URL="http://www.usenix.org/publications/library/proceedings/als00/2000papers/papers/full_papers/sears/sears_html/"]Here [/URL]is an article about it

Member Avatar for Ancient Dragon
0
27
Member Avatar for WASDted

[QUOTE]Signature spam... Still waiting for them new rules ;)[/QUOTE] Don't hold your breath while waiting for that :)

Member Avatar for happygeek
1
234

The End.