15,300 Posted Topics

Member Avatar for etc123

maybe you included the same header file more than once and left out the code guards.

Member Avatar for mitrmkar
0
444
Member Avatar for s1986

>>Can you please suggest me a way to remove this error? Don't do that.

Member Avatar for monkey_king
0
102
Member Avatar for yuvaraj.tr

why would you want to return some integer instead of true/false? If bool is inappropriate for that function then just change the return type of the function.

Member Avatar for monkey_king
0
130
Member Avatar for death_oclock

Learn to use your compiler's debugger and step through the code one line at a time so that you can see what it is doing. line 292: you are attempting to treat a 2d array of REALIZATION structures as if it were a 1d array. It needs two stars, not …

Member Avatar for Ancient Dragon
0
151
Member Avatar for booker

I assume you mean you want the file to look somethng like this: [code] 1 2 3 4 5 6 7 8 9 [/code] just create a loop to count from 0 to 2 and use fout to save each matric element. After the third element is written then write …

Member Avatar for Ancient Dragon
0
133
Member Avatar for chadactive
Member Avatar for serkan sendur

You can read about my reasons [URL="http://www.daniweb.com/newsletter/2007-05-01.html"]here[/URL]. Browse around the other archive articles and you will find many other members and their reasons.

Member Avatar for Narue
0
309
Member Avatar for lllllIllIlllI
Member Avatar for power_computer

After a little testing I don't think its possible to prevent someone from closing the console window. I tried the code below with vc++ 2008 Express, but it doesn't work because SetWindowLong() returns 0 and the windows error message is "Access is denied". I assume its a permission thing. [code] …

Member Avatar for nucleon
0
1K
Member Avatar for phoenix2391

setprecision(2) [code] #include <iostream> #include <iomanip> using namespace std; int main () { int c; cout << "Celcius: "; cin >> c; cout.setf(ios::fixed); cout << "Fahrenheit: " << setprecision(2) << (((float)c*9.0)/5.0)+32.0 << '\n'; return 0; } [/code]

Member Avatar for Ancient Dragon
0
128
Member Avatar for tbk

The problem is more than likely dlls. Check your compiler's installation directory to see if it has the DLLs that you need to install on other computers. Also make sure you compile your program for release mode and not debug.

Member Avatar for tbk
0
181
Member Avatar for VarunV

Do you mean the assembly instructions rshit and lshift? The C equivalent are << and >> operators [code] int a = 123; int b = a << 1; // left shift by 1 [/code]

Member Avatar for ArkM
0
98
Member Avatar for guest7

argv is an array of character arrays so you can't use the > operator to compare a character array with a std::string. What you need to do is 1) junk should be an int, not a std::string 2) use [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/strtol.html"]strtol()[/URL] to convert argv[is] to an int then compare the two …

Member Avatar for Ancient Dragon
0
88
Member Avatar for lllllIllIlllI

[QUOTE=arshad115;822248]o yes,it is "stdio.h". what i have learned is that we donot use ".h" in VC2008 like : i use "iostream" not with ".h"[/QUOTE] That's not really correct either -- there are thousands of header files with .h extensions used in c++, such as windows.h because there are no equivalent …

Member Avatar for lllllIllIlllI
0
239
Member Avatar for WesFox13

what is num ? It needs to be either double or float ([URL="http://www.cplusplus.com/reference/clibrary/cmath/sqrt.html"]link[/URL]). If it isn't then typecast it to one of these.

Member Avatar for WesFox13
0
91
Member Avatar for pdwivedi

There are two versions of getline() -- one for character arrays and the other for std::string. If variable colour is a character array then use [icode]cin.getline(colour, sizeof(colour));[/icode], otherwise if colour is a std::string then [icode]getline(cin, colour);[/icode]

Member Avatar for Ancient Dragon
0
201
Member Avatar for vishy_85

Its because you never changed the original value of template, only changed a local copy of the pointer. On line 69 you need to copy -- see strcpy() -- the value of temp_dat into template, not just assign the pointer. Line 71 is completly unnecessary and causes a memory leak. …

Member Avatar for Ancient Dragon
0
133
Member Avatar for The Dude

[QUOTE=The Dude;821322]Ahhhhhh, I hope no one is mad about my title...[/QUOTE] I'M MAD AS HELL AND I WON'T TAKE IT ANY MORE :)

Member Avatar for The Dude
0
303
Member Avatar for nosnibor

nosibar: acceptable code tags are [noparse][code=cplusplus] ... [/code][/noparse] The way to call base class from derived [code] void DERIVED::Method() { BASE::Method(); // call Method() is base class. } [/code] Note that its not necessary to pass the this pointer because that is passed by default.

Member Avatar for vicky_dev
0
1K
Member Avatar for Duki

>>Could someone tell me what I'm doing wrong? No because you need to post the class and the error message(s)

Member Avatar for Duki
0
178
Member Avatar for chiurox

>> if (sig[i] != text[i]) You can't use the same counter here because sig and text can be of different lengths. If sig == "screeeeewxd" and text == "scr*w?d" then I would do this: [code] int main() { char* text = "scr*w?d"; char* sig = "screeeewxd"; int i = 0; …

Member Avatar for Ancient Dragon
0
456
Member Avatar for winrawr

>>is it bad practice to put an assignment in an if statement? IMO -- no, I have done that occasionally, especially in loops [code] int x; while( (x = getnumber() ) == 0) { // do something } [/code]

Member Avatar for winrawr
0
90
Member Avatar for NicAx64

Does anyone know what the hell NicAx is rambling about? I read the whole post and still don't know -- something about difference between married and single people. Advice: if you are jealous then get married!

Member Avatar for MosaicFuneral
0
289
Member Avatar for wrxhokie

Looks like the function is prototyped incorrectly. Change the prototype in the header file to match the library.

Member Avatar for Ancient Dragon
0
202
Member Avatar for Dewey1040

1) both functions use the [b]extern[/b] keyword incorrectly. [b]extern[/b] means it is coded in some other translation unit, which the code you posted is certainly not. 2) can't tell just what the difference is because I don't know what the macro NEXT does. My guess is that it is causing …

Member Avatar for Ancient Dragon
0
104
Member Avatar for beto_best
Member Avatar for abby2589

>>for(i=0;i<=2;i++) That will print 3 structures, not 2. what you want to do is use the < operator, not the <= operator.

Member Avatar for Ancient Dragon
0
90
Member Avatar for sayeediqbal

This appears to be some sort of 4GL SQL code that's written in original K&R style. Other than that, I don't really know what the code is doing.

Member Avatar for Narue
0
80
Member Avatar for Comatose
Member Avatar for Ancient Dragon
0
1K
Member Avatar for Jhun Phil

Tough luck. Obama is looking out for #1 (USA) not the world. We here in USA have long disliked outsourced call centers mainly because the person on the other end of the line can't speak English very well, or speaks with an accent that is difficult to understand. So yes, …

Member Avatar for GrimJack
0
184
Member Avatar for aminura

make a minor change and it will be easier to use and see what is going on.(you don't have to type all those numbers every time you run the program.) [code] int main() { int a[2][3] = {0}; int *ptr = *a; int count = 1; for(int i=0;i<2;i++) { for(int …

Member Avatar for charleen
0
295
Member Avatar for Samran

>>char *array; That is not a 2-dimensional array. [icode]char **array[/icode] is how to declare it, using two stars not just one. Here is one way to initialize it [code] char **array = 0; array = new char*[rows]; for(int i = 0; i < rows; i++) array[i] = new char[columns]; [/code]

Member Avatar for Samran
0
3K
Member Avatar for nosnibor

line 28: delete that if statement because if the program gets that far its 100% true that the word was not found. So all you need to do at that point is display the error message. lines 22 and 23: you have already read the line that begins "Hardtop" on …

Member Avatar for nosnibor
0
87
Member Avatar for bluemm87
Member Avatar for ArcRaider
Member Avatar for Valkyriecoder

Welcome to DaniWeb. See our [URL="http://www.daniweb.com/forums/forum133.html"]Project Partners Wanted[/URL] forum

Member Avatar for milgo
0
67
Member Avatar for rickster11

If you want the % sine then input the data as a string then convert to double laber so that the % symbol will be removed from the keyboard buffer. [code] std::string input; cout << "Enter a percent"; getline(input, cin); double n; stringstream str(input); str >> n; [/code]

Member Avatar for tux4life
0
179
Member Avatar for jayli27

If you want to convert that to C language then replace cout with printf() statements, fout with FILE, seeg() with fseek(), etc.

Member Avatar for siddhant3s
0
366
Member Avatar for me_ansh

what is a "proc file"? If you want to find the size of a file that is stored on your hard drive then there are a cople opeions: (1) call _stat() function, or (2) open the file, seek to the end, then get the current file pointer position.

Member Avatar for MosaicFuneral
0
122
Member Avatar for ahfrey85

>>if (seats[position]=0) You need to use the boolean operator == instead of the assignment operator =.

Member Avatar for ahfrey85
0
125
Member Avatar for karthik.c

>>A request for filename /root/Desktop/scjp.txt Received.. which machine do you expect the file to reside on? If the file is on the client machine than of course the server don't find it because server is looking on its own computer.

Member Avatar for Ancient Dragon
0
182
Member Avatar for happygeek

I would nominate [URL="http://www.daniweb.com/forums/member.php?find=lastposter&t=172938"]ArkM[/URL] due to his excellent help in the C and C++ boards (I don't know where else he is at).

Member Avatar for jbennet
0
617
Member Avatar for crewxp

The problem is that you are leaving the <Enter> key in the keyboard after getting the number of students. After numeric input like that you have to flush the keyboard of the '\n' character. [code] double sum=0; printf("How many students are in class %d?\n",(i+1)); int t=0; scanf("%d",&t); [color=red]getchar();[/color] [/code]

Member Avatar for siddhant3s
0
296
Member Avatar for 10Pints

Another reason you might get that error is [list] [*]The file is already exclusively opened by another program [*]Some anti-virus programs cause that problem [/list] Try rebooting your computer to see if that corrects the problem.

Member Avatar for 10Pints
0
252
Member Avatar for nav33n

[code] <form method='post' onsubmit='javascript: validateform(this);'> [/code] Testing ... testing Yup -- its broke all right. I deleted the <b></b> from the original post and its back again.

Member Avatar for nav33n
0
222
Member Avatar for Ancient Dragon

[URL="http://www.telegraph.co.uk/news/newstopics/howaboutthat/4938881/Motorist-stopped-by-police-for-laughing.html"]This guy [/URL]was arrested somewhere in UK for laughing while driving.

Member Avatar for vegaseat
0
44
Member Avatar for The Dude

That's crazy. "Four Yards Worth" shouldn't have an apostrophy. And there are other wrong answers too.

Member Avatar for almostbob
0
316
Member Avatar for vinaychalluru

I would depend on the programming language. Boost has a regexp library for c++.

Member Avatar for Rashakil Fol
0
95
Member Avatar for Mossiah

if you can't use standard C function strcat() then your function looks ok to me. But you could also use pointers [code] void concatString(char *szTarget, const char* szSource) { while( *szTarget ) szTarget++; while( *szSource ) szTarget++ = *szSource++; *szTarget = 0; } [/code]

Member Avatar for siddhant3s
0
84
Member Avatar for h3llpunk

C++ doesn't support animation very well -- better off using something like DirectX or OpenGL

Member Avatar for h3llpunk
0
81

The End.