6,741 Posted Topics

Member Avatar for cassie_sanford

>My friend and i were having a discussion the other day and we were >having a heated argument about how to make that dang diamond >pattern in C++ code A heated discussion, huh? Why not just write the damn thing and be done with it? There's not exactly anything to …

Member Avatar for NathanOliver
0
442
Member Avatar for Narue

When you want to remove extraneous characters from an input stream in C++, it's usually because you mixed formatted and unformatted input methods. The formatted method would leave a newline in the stream and the unformatted method would consume it and terminate successfully, but fail completely to do what you …

Member Avatar for Smn
18
13K
Member Avatar for justinlake888

I see a disturbing lack of the main function, that just might be your problem. ;) Note that executable code needs to be in a function.

Member Avatar for hermel
0
2K
Member Avatar for The Mad Hatter

[B]>First - unlike the most of you, I've read Microsoft's financial reports, and understand accounting.[/B] I find that statement somewhat insulting. "Unlike most of you, I know what I'm talking about...". Presumably you think "most" of us are oblivious pimple-faced kids in our parent's basement living off of ramen noodles …

Member Avatar for ZZucker
-2
310
Member Avatar for ToucheAmore

[QUOTE]since you are just starting, learn c and c++ first. these are a must learn. if u learn these then you should have no problem in learning others.[/QUOTE] Really? So by learning C and C++ I'll have no trouble with LISP, or Haskell, or APL? Sure, learning C and C++ …

Member Avatar for priyaspageo
0
550
Member Avatar for VIeditorlover

[B]>the only goal is strong protection.[/B] Why does your code need to be protected? Usually when someone asks for this, they're under the false impression that not being able to (easily) reverse engineer the code somehow makes the application more secure.

Member Avatar for JOSheaIV
1
1K
Member Avatar for agent.orange

Since this isn't an assignment, the correct answer is to ditch that piece of shit compiler and get something from the current decade. You'd have no end of troubles using a 16-bit compiler on a modern 32 or 64-bit OS anyway (the environment 99.99% of Turbo C folks are trying …

Member Avatar for manishsaini09
0
351
Member Avatar for terence193

[QUOTE]How can I print it from the main? I know it sounds stupid, but I am still a beginner to the language.[/QUOTE] There are three conventional options for accessing the calculated result in a function from the calling function: [list=1] [*]Return the result from your function: [code] #include <stdio.h> #include …

Member Avatar for panpwintphyu.loo
0
240
Member Avatar for mansoorhacker

A hardware barcode scanner will interpret the barcode for you and return a string. It's dead easy, just like reading from standard console input.

Member Avatar for brent-me
0
339
Member Avatar for kickbass6

Array sizes in C++ must be compile-time constants. In other words, you can't do that. However, you [i]can[/i] fake it using pointers and dynamic allocation: [code=cplusplus] cin>> size; int *array = new int[size]; [/code] But don't forget to free the memory.

Member Avatar for vmanes
0
5K
Member Avatar for pittdaniweb

That was a question for a [i]job[/i] interview? If you couldn't answer it, I'm inclined to say that you're a perfect candidate. :icon_rolleyes: Anyway, the expected answer is probably that the for loop is counted and the while loop is not. Though that's only a superficial difference because you can …

Member Avatar for rajii93
0
814
Member Avatar for mrmonkee

>This is a program convert a string to ASCII. No, it's a program that prints the integer value of each character in a string instead of the character representation. >#include <iostream.h> You're about ten years too late with this. The correct C++ header is <iostream>, and you need to qualify …

Member Avatar for erim.aljerrah
0
20K
Member Avatar for SpS

>Can anyone explain me in simple language and better if with an >example why constructor don't have return types Here's an idea. Show us how it could be done without breaking all kinds of existing code, and you'll answer your own question.

Member Avatar for ishan_1
0
739
Member Avatar for AnnYzz

>Well from wot i no pseudocode isnt real code so how can i test it? The same way you test real code without running it: trace the execution with paper and pencil using a small amount of sample data. Not only does this give you a better idea of what …

Member Avatar for diafol
0
388
Member Avatar for bhagyap

What you want is obfuscation rather than encryption, assuming the intention of encrypting the DLLs is to hinder reverse engineering efforts. There are a number of tools (Visual Studio comes packaged with Dotfuscator's community edition). Just Google for ".net obfuscation".

Member Avatar for Rajeev Nambiar
0
999
Member Avatar for Ghost

>static int countChars( String str, char searchChar ) This only returns the count for a single character. So to find the most common character, not only would you be forced to call countChars for [b]every[/b] character in the string, you would also need to find a character with the largest …

Member Avatar for JamesCherrill
0
3K
Member Avatar for Snehamathur

[B]>Is this Program Correct? or is there more conditions to check..?[/B] No and no, respectively. Your algorithm for the leap year condition is correct, but your code has a little to be desired. [B]>#include <conio.h>[/B] This header is completely unnecessary for this program. I highly recommend you get out of …

Member Avatar for stephen.beatson
0
385
Member Avatar for rocky2008

>I have read that this requirement is going to be relaxed in the next >revision of the standards, but no compilers have implemented that >yet (for obvious reasons) Mixing declarations and executable statements is a feature that's been available since C99, and quite a few compilers support it.

Member Avatar for Ancient Dragon
0
935
Member Avatar for harshchandra

[QUOTE]The code is awesome.[/QUOTE] That's debatable. [QUOTE]Why is that temp = *q done inside else loop too?[/QUOTE] An oversight most likely (given the quality of the rest of the code). Good luck getting harshchandra to reply though, last activity from that account is from 2007.

Member Avatar for hanumant113
1
821
Member Avatar for lara_

>i just want to whether there is a replacement for getch() in C++. There isn't a standard equivalent for getch in either C or C++. >my friend said getch() is C function. No, getch is a compiler extension. You can use it in either C or C++ if your compiler …

Member Avatar for nootan.ghimire_1
0
7K
Member Avatar for daniweb2013

>Researching and creating a limited compiler that works on a subset of a >chosen language is a very beneficial learning excercise for the computer >engineer / software developer. Writing a compiler is a beneficial learning exercise, but not a C++ compiler. That's like saying that a hand made tool shed …

Member Avatar for LordoDeGrim
0
752
Member Avatar for mayankjoin
Member Avatar for Niranjana_1
0
1K
Member Avatar for daviddoria

>What is standard practice? Most people just define their own as needed: [code=cplusplus] const double PI = 3.141592; [/code]

Member Avatar for duskoKoscica
0
2K
Member Avatar for dhingra

Storage classes specify where an object is stored, its visibility (linkage) and how long it exists (storage duration). There are three forms of linkage (summarizing): [LIST] [*]external: The object is visible across the entire program. [*]internal: The object is visible only to a single file. [*]none: Basically a "super internal" …

Member Avatar for salil_ag
0
170
Member Avatar for mariners95

If it's a square matrix then you can do it with something like this: [code] for (int i = 0; i < 4; i++) { for (int j = i + 1; j < 4; j++) { int save = matrix[i][j]; matrix[i][j] = matrix[j][i]; matrix[j][i] = save; } } [/code] …

Member Avatar for johnnew
0
400
Member Avatar for sutty8303

This solution won't work for you, but it should give you a push in the right direction: [code] #include <iostream> using namespace std; char letter_grade(int grade_num) { char limit[][4] = {90,80,70,60,'A','B','C','D'}; for (int i = 0; i < 4; i++) { if (grade_num >= limit[0][i]) return limit[1][i]; } return 'F'; …

Member Avatar for Faisal Kazmi
0
18K
Member Avatar for srinath reddy
Member Avatar for kakilang

[code] #include <stdmagic> using namespace std; int main() { magically_do_something_platform_and_implementation_specific(PLAY_MUSIC, "hello.mpg"); } [/code] By the way, what OS and compiler are you using? :rolleyes:

Member Avatar for 4reebahmedkhan
1
10K
Member Avatar for nileshjaiswal

>C++ is a superset of C Not really. A is only a superset of B if A contains everything in B (and optionally more). This isn't the case with C and C++, especially considering the evolutionary path of C since C++ was created. Rather, C++ is based on C, and …

Member Avatar for frta
0
761
Member Avatar for ~s.o.s~

[QUOTE=Melando;1703232]Attention: rtrim could modify memory outside string range[/QUOTE] While you're correct, the bug report is unhelpful because you haven't specified when this would happen or suggested a fix. The problem stems from an unchecked decrement of [ICODE]original[/ICODE], which can drop below [ICODE]string[/ICODE] if it's empty of contains nothing but [ICODE]junk[/ICODE] …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for wendas

>right now it is only to make sure we are more marketable >as our company is going down the tubes. Changing your implementation language because it's more "popular" isn't going to save a company. >I would imagine, it must be popular due to the benifits it has over VB. Not …

Member Avatar for Momerath
0
276
Member Avatar for policeachan

I can easily see this thread being kept alive for four [b]more[/b] years with "me too!" posts, so I'm closing it.

Member Avatar for Nishant_2
0
1K
Member Avatar for kandarpa

C99 added __func__, which evaluates to the name of the currently executing function. __FUNCTION__ is a common non-standard extension that does the basically same thing.

Member Avatar for बालाजी
0
7K
Member Avatar for gcardonav

>What is the use of using namespace std; ? Namespaces are like drawers in a filing cabinet. All of the standard library is in one drawer, and the only way to get to the stuff in that drawer is to tell C++ where to find it. You do that by …

Member Avatar for StanleyLau
0
4K
Member Avatar for winky

[QUOTE]My thought process was that I could start the loops at the beginning and the end of the string and then swap the two characters. Then, I could increase the iteration of the beginning by one and decrease the iteration of the end by one, and the repeat the swap.[/QUOTE] …

Member Avatar for Joshua_3
0
1K
Member Avatar for jingda

I've pretty much just stuck with cats. Presently there are two in my home (plotting my demise, no doubt): Narue and Newton.

Member Avatar for <M/>
0
430
Member Avatar for max2011

[QUOTE=max2011;1437914]hi. i am marsh a student guys i have a activity but i don't know to start it with a loop. can you help me? ***** ***** **** **** *** *** ** ** * * ** ** *** *** **** **** ***** *****[/QUOTE] This is actually easier than the corresponding …

Member Avatar for Gonbe
0
193
Member Avatar for sargarpramod

>void main (void) This is not (and never has been) correct C. The main function returns int. >a variable of type char is just an 8-bit int. Just to be thorough, even though your reply is over a week old, char is only guaranteed to be [i]at least[/i] eight bits.

Member Avatar for tilakkumar
0
3K
Member Avatar for me.sapna

I know that it's easy to misread "Daniweb" as "rent-a-coder", but we don't do that here. If you have a specific problem we can help you, but we won't do your work for you and hand it to you on a silver platter.

Member Avatar for ddanbe
0
437
Member Avatar for nithysony
Member Avatar for silentdragoon

Here's as simple as it gets with separate chaining, with some rudimentary testing. I wrote it in a few minutes, so don't blame me if there are bugs. ;) [code=c] #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct node { char *data; struct node *next; } node; unsigned djb_hash ( …

Member Avatar for arshdeepkaur
0
673
Member Avatar for fmasroor

Is <iostream.h> the new <graphics.h>? :icon_rolleyes: Here's an idea: update your code to use <iostream> if your compiler doesn't support the non-standard and non-portable <iostream.h>.

Member Avatar for Schol-R-LEA
0
26K
Member Avatar for Yustme

[code] if (islower(*sPtr)) *sPtr = toupper(*sPtr); [/code] There's no need for islower because toupper will convert the character as requested, or do nothing if there's no conversion or if the character is already upper case. In other words, toupper "just does the right thing". However, because your function can't guarantee …

Member Avatar for brcsur
0
9K
Member Avatar for fishsticks1907

[QUOTE]Is there a basic criteria for a entry level programmer?[/QUOTE] When hiring entry level programmers, I've always looked for three things: [list=1] [*][B]Willingness to learn[/B]: Since we're talking about bottom of the barrel as far as applicable skills goes, the candidate absolutely must be a sponge for knowledge. [*][B]Passion[/B]: Entry …

Member Avatar for falchion-gpx
0
350
Member Avatar for Kiba Ookami

>why are there so many programming languages out there? [satire] I was wondering, why are there so many tools out there? I mean, I've learned a bit of hammering, a bit of wrenching and a bit of screwdrivering (which I didn't like) and I was wondering, why others keep making …

Member Avatar for Mrewan79
0
756
Member Avatar for bops

>this seems to work but only for up to 4 letter words somehow. It seems the size of a pointer is four bytes on your system. >char * ret = (char*)malloc(sizeof(array) + 1 + 1); sizeof doesn't do what you want here. It's giving you the size of a pointer, …

Member Avatar for NathanOliver
0
5K
Member Avatar for kux

Last I checked (which I admit was a while ago), there weren't any free tools that I would put on a list along with splint. I use PC-Lint and Flexelint for C++ but they're neither free nor cheap.

Member Avatar for IssamLahlali
0
255
Member Avatar for Awais Ali

I suspect they use several. Can you be more specific about which feature of facebook you're referring to?

Member Avatar for BigBang@12
0
833
Member Avatar for SWAT

[QUOTE]Hi Can you change my username to libertyreservehosting[/QUOTE] Can do.

Member Avatar for <M/>
0
1K
Member Avatar for SHWOO

I imagine that those are member functions and their definitions need to be prefixed with [INLINECODE]playerType::[/INLINECODE].

Member Avatar for saba.gul.1048554
0
262

The End.