1,358 Posted Topics

Member Avatar for Torbalan4o

[URL="http://www.daniweb.com/forums/announcement8-2.html"]So what have you done so far?[/URL]

Member Avatar for Fbody
0
96
Member Avatar for whiteyoh

I believe you have an extraneous comma before the WHERE in your query, but you don't have any error-checking. To help correct this, add [CODE]if (!$result) { die("Unable to update table ".mysql_error($conn)); }[/CODE] after line 16. See if that tells you anything. Then report back

Member Avatar for shashankshah
0
104
Member Avatar for peck3277

Your $x is a string, you should really have it be an integer. Then, all you would have to do is divide by 100. If you need a string for some reason, you could try to use intval() to extract an integer value from the string. You still would have …

Member Avatar for darkagn
0
122
Member Avatar for Fbody

A couple days ago, I was involved in [URL="http://www.daniweb.com/forums/thread258996.html"]this thread[/URL] which concerns bit shifting (kind of) and a solution was found (by someone else). The problem is, something about the solution never really sat right with me. Hopefully someone can clarify this for me. [B]Code:[/B] The code uses 1 constant …

Member Avatar for Fbody
0
164
Member Avatar for AdamE34

You could try using an if statement with the loop's counter and the mod operator (%) to break it up into n rows of x columns. [code] const int ROW_SIZE = 5; for (int i = 0; 1 <= 20; i++) { /* read input */ /* write output */ …

Member Avatar for AdamE34
0
141
Member Avatar for DJPlayer

[QUOTE=DJPlayer;1128280]this is for a C program.. not C++. I posted in here because I was gonna build in C then transform.. so I doubt I can use stringstream.. =/ ugh[/QUOTE] You won't have much luck with this in C. Everything you've done so far is based on C++. C is …

Member Avatar for Dave Sinkula
0
226
Member Avatar for nats01282

You should be able to just output to the console then copy from there... Or, write it to a txt file then copy it from there... Substantially less effort than interacting with a window.

Member Avatar for VilePlecenta
0
1K
Member Avatar for eternaloptimist

[QUOTE=eternaloptimist;1128137]i have a few questions.: 1)if i wanted to write a line of code needed to declare a 1-dimensional array named names that can hold 8 string values would this be correct?: char names[8];[/quote] char names[8] would not do what you want. That would create an 8-element array with each …

Member Avatar for eternaloptimist
0
107
Member Avatar for liljazz2007

[URL="http://www.daniweb.com/forums/announcement8-2.html"]This might help.[/URL] [URL="http://www.lmgtfy.com/?q=SRC+Assembly"]This might help too.[/URL]

Member Avatar for Nick Evan
0
243
Member Avatar for ghalibsultan

[URL="http://www.daniweb.com/forums/announcement8-2.html"]Good luck with that.[/URL] Let us know when you decide not to cheat. Maybe we can help then. Grrr.....You're lucky I goofed on the rep button...

Member Avatar for WaltP
-1
82
Member Avatar for wolfhunter777

Kudos for an excellent first post :cool: Are the "isAlive" functions static? I think you may be referencing them incorrectly when you call them in your conditionals. It seems like the compiler would have thrown an error though... Also, is there a reason for all 6 *List.erase() lines being commented? …

Member Avatar for WaltP
1
107
Member Avatar for suncica2222

int main() is the required format under the ANSI/ISO standards. If you return anything but an int, it can lead to system issues. Some compilers will even complain if you try to return anything but an int. As far as value is concerned, zero (0) is considered the "universal" success …

Member Avatar for Narue
0
84
Member Avatar for totalwar235

If you continue to ignore people, you'll get more -rep. Read jonsca's posts again. A big part of your answer is right there staring you in the face. Check your use of single vs. double quotes. Edit: nvm... I missed posts 11, 12 while catching up.

Member Avatar for totalwar235
0
321
Member Avatar for AlmaREY

You don't have to post the personal information contained within the comment block(s), omit that part when you post your code. That's an issue that is pretty simple to figure out. It is important to be clear, which you have been. But without the code, all the clarity in the …

Member Avatar for Ancient Dragon
0
275
Member Avatar for devster123456

What does your output look like now? That will help steer you in the right direction. Ask yourself "What statement can I move where to make this look right?" Or possibly, "What extra statement do I need to add to make this look different?"

Member Avatar for Agni
0
451
Member Avatar for cwarn23

[QUOTE=JasonHippy;1125534]...shifting x by 32 places in either direction will give you x![/QUOTE] I don't think this is correct. I'll admit, I'm still figuring out bitwise operators myself, but last I knew they don't wrap around. (Still looking for reference where I read it.) The way I understand it is if …

Member Avatar for dusktreader
0
382
Member Avatar for cgib

Your post is confusing me. Do you have the actual dll or did you simply download and #include the header for it? I'm sure you know it, but you need both...

Member Avatar for Fbody
0
73
Member Avatar for gregarion

Perform a select query to look up the movie. If a record is returned, it already exists. Once you know if the record exists, or not, you can then either report an error condition or perform the insert.

Member Avatar for Fbody
0
144
Member Avatar for gregarion

Have you tried using string concatenation to build the query before you send it? [code] string NewMovie, queryText; cout << "Enter the title of a movie: "; getline(cin, NewMovie); /*use getline() instead of cin >> because some movies have more than 1 word in name cin >> breaks input stream …

Member Avatar for Fbody
0
2K
Member Avatar for timbomo

1.) [URL="http://www.catb.org/~esr/faqs/smart-questions.html"]Read this.[/URL] 2.) Answer these: [INDENT]A.) What are you trying to accomplish? We can't help if we don't know that. B.) What are the errors you are getting? Again, can't help if we don't know. C.) Why is there a '}' on line 1? What is the scope that …

Member Avatar for Lerner
0
117
Member Avatar for jimFan

[QUOTE=rbregs;1125446]can you make an infinite program using do while loop??[/QUOTE] You can make an infinite loop with any loop structure, it just depends on how you write it... @OP: According to [URL="http://www.cplusplus.com/reference/string/getline/"]this article[/URL], getline has a default delimiter of '\n' that it detects and discards. The issue may be that …

Member Avatar for Fbody
0
1K
Member Avatar for Violet_82

First, I would like to emphasize that program lines don't change. What changes is [U]the information contained within the variables[/U] used/defined by those lines. Your code tells the computer how to use and change that [u]information[/u]. Second, I think it might be advisable for you to read some tutorials: [URL="http://www.cplusplus.com/doc/tutorial/functions/"]Functions[/URL] …

Member Avatar for Violet_82
0
148
Member Avatar for arithehun

[QUOTE=arithehun;1122152]I am trying to create an expression evaluator to expand my C++ knowledge. It is supposed to evaluate 5(x+7)-2. Here is the code: [code=c] #include <iostream> #include <stdio.h> #include <time.h> using namespace std; time_t now, later; void sleep(int delay) { now=time(NULL); later=now+delay; while(now<=later)now=time(NULL); } int main(void){ //It finds an error …

Member Avatar for arithehun
0
189
Member Avatar for Lukezzz

I can't help with your settings. But I have a couple questions that may help. Obviously, I don't know your machine's performance specs, but it could be an issue with your machine's performance. Have you tried running the exe on a different machine to see what happens? This could help …

Member Avatar for Lukezzz
0
120
Member Avatar for Dizzzy

Will type casts work? i.e. [icode][b](const char *)[/b]results.st_size[/icode] This should enable it to compile, but honestly, I suspect you'll get invalid results.

Member Avatar for mitrmkar
0
314
Member Avatar for suncica2222

[QUOTE]I use MS VC++6 and when I type code I have problem...let's say I have 123456789 typed and I place cursor between 4 and 5 and than type "something" I get 1234something and not 1234something56789[/QUOTE] Sounds like you're in overwrite mode instead of insert mode, hit your [insert] key. The …

Member Avatar for suncica2222
0
89
Member Avatar for Dani

Umm.... this thread is 7 years old. Why did you res it just to say thanks to someone that wasn't even talking to you? An unfortunate waste of a first post...

Member Avatar for Fbody
0
1K
Member Avatar for walter clark

I have VS 2008 as well (not quite as much experience, but oh well). One of the first things I noticed about 'watch'es is that sometimes even though a variable's name and information are in-scope, the copy of it that you are looking at may not be. You actually need …

Member Avatar for walter clark
0
125
Member Avatar for mimis

I have concerns related to this (it's probably nothing though): [CODE=c++]//at the end delete[] arr[0]; delete[] arr[1];[/CODE] I'm not too sure it will work correctly. Reason: Since an array technically is just a pointer to the first element of the array, won't you lose access to your whole array if …

Member Avatar for Fbody
0
97
Member Avatar for mmasny

It's an inherited member. You can't initialize an inherited member in a local constructor's initialization list because the inherited members don't exist yet. If there is any initialization you need to do to an inherited member, you will either need to do it in the inherited object's constructor or in …

Member Avatar for mmasny
0
303
Member Avatar for ayushii

[QUOTE=ayushii;1119863]plsssssssss help me guys ..... i want a c++ code for arithmetic & scientific calculators individually,..... plsss help... i need it within a few days.......plsssssss[/QUOTE] This thread was started by someone else for a completely unrelated topic: 1. don't thread hijack, 2. read the forum rules, we refuse to do …

Member Avatar for WaltP
-5
101
Member Avatar for Stefano Mtangoo

I am not familiar with Code::Blocks but several other members here seem to like it. If you are running Windows, I know that MS-VC++ is capable of doing everything you mentioned. Stay away from Dev-C++, its debugger leaves something to be desired. I have no idea about Unix or Linux …

Member Avatar for Stefano Mtangoo
0
228
Member Avatar for jayrana

[QUOTE=ployer;1118975][B]Oh and the Arrow designator "->" is for referencing a method or property of an object, much like the "." in Java or C#.[/B] It can also be used to denote a pointer. Incase you are wondering as well when you see the "&" infront of a variable name that …

Member Avatar for Fbody
0
189
Member Avatar for fenerista

I would store the files in a location easily accessible from both projects then include them in the project(s) respective solutions... Unless you're trying to make a DLL or something, then I can't help you...

Member Avatar for fenerista
0
264
Member Avatar for SpyrosMet

Are your header files macro-protected? [url=http://www.daniweb.com/forums/post1114822.html#post1114822]Clicky[/url]

Member Avatar for SpyrosMet
0
119
Member Avatar for newbie2010

It sounds like you are simply calling the function and having it output to the browser which is not sufficient. You need to use the DOM and update the appropriate nodes through AJAX. If you're not familiar with the DOM and AJAX [url=http://www.w3schools.com/ajax/default.asp]click here[/url].

Member Avatar for Fbody
0
145
Member Avatar for clutchkiller

Can you do something with an if then ladder that marks the beginning of each month similar to a grade calculation? [code=c++] /* for grading scale */ char grade; int score; if (score > 90) grade = 'A'; if (score > 80) grade = 'B'; /* ...etc... */ [/code] Then …

Member Avatar for clutchkiller
0
308
Member Avatar for Szabi Zsoldos

First things first, on lines 21, 25, 26... where did 'a[]' and 'i' come from??? Did you define them elsewhere? Are they properly initialized? Second, why can't you just put an accumulator in your for loop then put the appropriate cout after the loop? Based on the segment you posted, …

Member Avatar for Szabi Zsoldos
0
561
Member Avatar for m_adeelkhan

[quote=m_adeelkhan;1118059]>...i donot ask u to write code for me ...[/QUOTE] Yes you did... [QUOTE=m_adeelkhan;1117132][B]>>...if some 1 can share code it will be quite help full 4 me[/B][/quote] [QUOTE=m_adeelkhan;1118059]...already make a code that was working properly on 3x3 board but not on 7x7 on 7x7 it work properly as human vs …

Member Avatar for WaltP
-1
157
Member Avatar for Zay

In the case of a class, you could do it within the constructor(s) as well if you don't want it static. Header: [code=c++] class example { private: int someVar; public: example(); /* default constructor */ example(int);/* overloaded constructor */ }; [/code] Implementation file: [code=c++] example::example(){ /* default constructor */ someVar …

Member Avatar for mrnutty
0
100
Member Avatar for Dizzzy

Why not store everything up to the '.' in one array, then everything after it in another array or a switch-controlled set of string literals? That way you can just use the program logic to output the file name then decide which extension to output... Or am I missing something? …

Member Avatar for Dizzzy
0
141
Member Avatar for motters

Just like any other database access, build a form then process the form. While you're processing the form build a query to 'UPDATE' the user's information in your database table.

Member Avatar for Fbody
0
338
Member Avatar for SpyrosMet

The OP's original question was already answered in [url=http://www.daniweb.com/forums/thread256949.html]this thread[/url]. But I think I need to address this: [QUOTE=hermann87;1117803]Try using the [B]this[/B] operator for your class variables to avoid confusion as you seem to be using a type String variable named kind in both your class and your main program. …

Member Avatar for SgtMe
0
132
Member Avatar for SpyrosMet

You are trying to use a default constructor without having a default constructor defined. EDIT: Part of your issue before was that you had an "overloaded" constructor but no default constructor, which normally isn't a good thing. It seems that it still thinks there isn't one. /EDIT: I suggest you …

Member Avatar for SpyrosMet
0
359
Member Avatar for mmasny

[QUOTE=mmasny;1117763]What is the public inheritance?[/QUOTE] C++ has 3 levels of inheritance (private, protected, and public). Although they are partially-related, these do not have the same meaning as the internal access levels within a class. Think of this version as meaning "the members of the base class will be shifted so …

Member Avatar for Fbody
0
126
Member Avatar for macman101

It's only been 25-mins. This is a forum, you can't expect immediate help. Consider yourself lucky I'm even posting. As far as your code goes, WTF are you trying to accomplish? All I'm seeing is a bunch of screwing around to assign an input to an array element. Why not …

Member Avatar for ChaseVoid
0
180
Member Avatar for cpu-guy

[QUOTE=cpu-guy;1115758]what does iterative version mean?[/QUOTE] It means that it's a demo, but not the answer you need. "This is what you need to accomplish, but a different way." You need a recursive version.

Member Avatar for cpu-guy
0
143
Member Avatar for NickRx

1.) Use code tags, Narue said something to you already 2.) y=f/2; if ( y= 0) cout<<"even"; else cout<<" odd"; is not even close. According to this code (if it were actually written correctly), the only even number that exists is '0'. First, you need to use the modulus operator …

Member Avatar for Narue
0
159
Member Avatar for Roger_Hades

Your information is a little vague. Are you getting compiler errors or is the program simply not behaving as intended? Regardless, these are my thoughts: [code=c++]class tropicalfruit //Class tropicalfruit { public: string name; double price; };[/code] This isn't a bad idea. Using public data members is not generally recommended practice …

Member Avatar for Fbody
0
12K
Member Avatar for jodysmith

[QUOTE=adnan.siddique;1115073]You should not tell him the solution. That is wrong[/QUOTE] I'm guilty of the mistake too, but that is the OP posting what they came up with after your comments. Their wording could have been much less snooty though.

Member Avatar for Salem
-6
472

The End.