5,676 Posted Topics

Member Avatar for Sin-da-cat

My first reaction is why bother with [I]strtok()[/I]? This is a simple program of characters, not tokens. Next, C has a function called [I]tolower()[/I] and [I]toupper()[/I] that will return the character passed in as an upper or lower case value. Good for comparing case insensitive values. It also doesn't affect …

Member Avatar for farooqiumar
0
2K
Member Avatar for DarkC0de

IMO you'd be better off writing something like [B]<*end*>[/B] between messages, rather than Ctrl-D in the file. Why would you want someone to enter Ctrl-D anyway?

Member Avatar for DarkC0de
0
774
Member Avatar for CppBuilder2006

[QUOTE=CppBuilder2006;1093535]when I deal with clipboard, I [U]have to[/U] use GlobalAlloc.[/quote] That makes sense. [ICODE]new[/ICODE] allocates within the realm of the program. Once the program exits, the memory is released. The clipboard then cleared (or broken). [ICODE]GlobalAlloc[/ICODE], I assume, leaves the allocated memory until the system clears it. [QUOTE=CppBuilder2006;1093535]is it recommended …

Member Avatar for CppBuilder2006
0
276
Member Avatar for peterpanic

[QUOTE=peterpanic;1093322]I am trying to take an integer argument (1-65536) and turn it into two hex characters. [/quote] First problem -- 65536 cannot fit in 2 hex characters. 0-255 can, but 65535 takes 4. [QUOTE=peterpanic;1093322]If argument -t is -t20 then I need 0x01 0x04 in a character array for sending through …

Member Avatar for WaltP
0
297
Member Avatar for serra01
Member Avatar for WaltP
-5
73
Member Avatar for cthoes

[QUOTE=cthoes;1092215]i couldnt understand how fseek(fp,-size,SEEK_CUR) helps to allocate the modified data at the location where name are found to be same. it would be great help how fseek points to the location where data is going to modified. [/quote] [iCODE]fseek()[/iCODE] doesn't allocate anything. It places the file pointer at the …

Member Avatar for WaltP
0
116
Member Avatar for daudiam

[I]size_t[/I] is a data [B]type[/B], not a data size. [I]int[/I] is a data type. [I]char[/I] is a data type. So is [I]size_t[/I]. What goes into it is the result of executing the [iCODE]sizeof()[/iCODE] 'function' -- it returns a data type of [I]size_t[/I].

Member Avatar for Dave Sinkula
0
196
Member Avatar for ayesha91

[QUOTE=Bench;1091894]... the underlying representation of std::string is not necessarily "null terminated"...[/QUOTE] Actually, a [ICODE]string[/ICODE] is [I]not[/I] "null terminated". Period.

Member Avatar for Lerner
0
159
Member Avatar for _Michael_

If you look inside limits.h you will see the maximum values allowed -- and the name of the variable representing the number

Member Avatar for WaltP
0
129
Member Avatar for akhil_s

Since no answer in 3 years to original question, probably no answer today... Check with business people in your country.

Member Avatar for WaltP
1
199
Member Avatar for cthoes

[url=http://www.gidnetwork.com/b-38.html]This might help[/url] in making your code readable. And [url=http://www.gidnetwork.com/b-57.html]here's what [B]Salem[/B] cryptically meant about fflush(stdin)[/url].

Member Avatar for WaltP
0
270
Member Avatar for vishalwiw@mail.

You are attempting to round based on the .5, not the .57. Each answer should be 11. Did you try desk-checking the code? Assume input = 10.57. You write down the result for each step and keep track of all the variables: [ICODE]b= b*10;[/ICODE] -- what's the value of b? …

Member Avatar for WaltP
0
144
Member Avatar for لولوة

[QUOTE=iamthwee;1090066]Just make everything public then you don't need to! [/QUOTE] Please reread [B]Narue[/B]'s response -- [I]carefully[/I] -- and you will see why this is a bad suggestion.

Member Avatar for Dave Sinkula
0
213
Member Avatar for _Michael_

Use an [iCODE]if[/iCODE] statement and an [url=http://www.asciitable.com/]ASCII Chart[/url] to test a character entered.

Member Avatar for WaltP
0
121
Member Avatar for hmadison1984

For first participation, you obviously ignored the request to read the forum rules, and completely ignored all the sticky posts at the top of the forum. We can't help you with the information you gave.

Member Avatar for WaltP
0
225
Member Avatar for rajif desmara
Re: ask

[QUOTE=rajif desmara;1090414]I search modul for to studying c++ code ??? plase...help me...[/QUOTE] You should read the Forum Rules to learn how to post a useful question. "Plase"...do it...

Member Avatar for WaltP
-1
38
Member Avatar for jan1024188

Only thing I'd add is extend the IF around the guts of the program: [code=c] #include <stdio.h> #include <stdlib.h> int main (void) { size_t len = 0 ; const char a[] = "c:/a/a.exe" ; const char b[] = "d:/b/b.exe" ; char buffer[BUFSIZ] = { '\0' } ; FILE* in = …

Member Avatar for luigi10011
-2
20K
Member Avatar for sunshine24

Every time you type a character in at [ICODE]scanf("%c",);[/ICODE], do you hit an ENTER? Where does that second character go? It gets read with the next [ICODE]scanf()[/ICODE]. See [url=http://www.gidnetwork.com/b-59.html]this series[/url] about why you should not use [ICODE]scanf()[/ICODE] for character & string input. Use [ICODE]fgets()[/ICODE] instead. And in your case, you …

Member Avatar for sunshine24
0
163
Member Avatar for ShortYute

Never use [ICODE]scanf()[/ICODE] to read a string ([url=http://www.gidnetwork.com/b-62.html]here's why[/url]). In your code, if you enter more than 5 characters you are overwriting memory you shouldn't touch.

Member Avatar for WaltP
0
129
Member Avatar for johndoe444

Not normally, although you can pipe stderr to a file by using [B]2[/B] in front of the pipe character: [iCODE]prog 2>err.file[/iCODE]

Member Avatar for WaltP
0
79
Member Avatar for cjwenigma

[url=http://www.gidnetwork.com/b-38.html]This information[/url] will help us help you if you follow the suggestions therein.

Member Avatar for peter_budo
0
130
Member Avatar for anthonytan
Member Avatar for MAV_DevWantaB
Member Avatar for rigidboss
Member Avatar for laelzio.mosca

[QUOTE=laelzio.mosca;1084899]I have this tic tac toe code, it`s almost working, can anybody take a look, I think the only thing wrong is in the else statement in main, but I`m not sure, I think I need to place the checkToWin and checkToBlock functions properly in main [/QUOTE] What make you …

Member Avatar for jonsca
0
109
Member Avatar for uzair ahmad

We don't do homework for people. Most of us already have graduated and don't need the grade. Read the Forum Rules and post an appropriate question and we can help.

Member Avatar for WaltP
-6
162
Member Avatar for johndoe444

[QUOTE=Narue;1084850][B]>What is the significance of the following format specifiers:[/B] Relatively low, but they come in handy occasionally.[/QUOTE] :twisted: :twisted: [CODE] %10s - Output a minimum of 10 chars, leading spaces %.10s - Output up to 10 characters %-10s - Output a minimum of 10 chars, trailing spaces %.15s - see …

Member Avatar for WaltP
0
161
Member Avatar for vivek_295
Member Avatar for Ancient Dragon
0
124
Member Avatar for restrictment
Member Avatar for Abdul wahid

First, [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. Second, look up the [iCODE]kbhit()[/iCODE] and [iCODE]getch()[/iCODE] functions in your compiler documentation.

Member Avatar for WaltP
0
134
Member Avatar for tinhdau_noinao

Welcome. While registering, new members are requested to read the Forum Rules and other pertinent information (sticky posts with obvious titles like [B]Read this first[/B]) before posting. Did you miss this request during registration? And in English, after punctuation like [B], . ?[/B] and [B]![/B] there is always a space …

Member Avatar for tinhdau_noinao
0
65
Member Avatar for Champhero

Open your compiler's IDE Type the code in you've written Save the code Run it and see if it works.

Member Avatar for WaltP
-4
75
Member Avatar for anthonytan

First off, rewrite the [iCODE]return[/iCODE] so it is understandable (i.e. simple). Then explain what you want. Your request makes little sense.

Member Avatar for WaltP
0
76
Member Avatar for staufa

[QUOTE=ahamed101;715494] Salem is right... String is uninitialised... you get junk for len... for sure... [/quote] Then why bring it up. He already had others confirm this. :icon_rolleyes: [QUOTE=ahamed101;715514]Yes, EOF is an issue... but while entering the character where does EOF comes into picture?... [/QUOTE] Anytime you pipe in a file …

Member Avatar for cthoes
0
327
Member Avatar for cthoes

[QUOTE=gerard4143;1081933]Right away you shouldn't use: [CODE] char name[20]; scanf("%s",&name); [/CODE] It should be: [CODE] char name[20]; scanf("%s",name); [/CODE] [/QUOTE] Actually, no it shouldn't. [url=http://www.gidnetwork.com/b-62.html]See this[/url].

Member Avatar for cthoes
0
101
Member Avatar for BestJewSinceJC

[QUOTE=BestJewSinceJC;1082174]I'm wondering where to find what values system() accepts. For example, I want to list the server's OS type. I already did man system, did not find it very useful. And google is returning a lot but nothing relevant.[/QUOTE] Type [I]HELP[/I] at the command line.

Member Avatar for BestJewSinceJC
0
78
Member Avatar for johndoe444

The first time the compiler processes the header, [ICODE]_global_h_included_[/ICODE] is undefined so the header is processed. During this processing, [ICODE]_global_h_included_[/ICODE] is defined. Each subsequent time the header is processed, [ICODE]_global_h_included_[/ICODE] is already defined, so the rest of the header is skipped thanks to the [ICODE]#ifndef[/ICODE]

Member Avatar for johndoe444
0
172
Member Avatar for BestJewSinceJC

[QUOTE=BestJewSinceJC;1082106]Ok, it just seems strange compared to how easy it is in Java.[/QUOTE] It just seems strange that girls have to sit down compared to how boys can just stand. Maybe it's the nature of the beast... Wondering why an orange and a cumquat aren't the same is a waste …

Member Avatar for WaltP
0
94
Member Avatar for RexxX

[QUOTE=Salem;474269]Some embedded DSP chips have 32-bit chars (and 32-bit everything else) for example.[/QUOTE] Wow! They must be for Chinese :)

Member Avatar for Narue
0
139
Member Avatar for grimbaum

Why use dynamic allocattion to define an 8x8 array? Just define board as [INLINECODE]int board[8][8][/INLINECODE]. Create a function to display the board and just call it.

Member Avatar for hunter666
0
156
Member Avatar for helixkod

[QUOTE=vmanes;481321]I'm in Rapid City - opposite side of the state from Sioux Falls. The better side side of the state.[/QUOTE] The Wall Drug side of the state? I hope that's not what makes it better!! :icon_lol:

Member Avatar for cibaiciao
0
252
Member Avatar for naej
Member Avatar for mrnutty
-1
70
Member Avatar for raghuhr84

[QUOTE=phpbeginners;1072065]i will give you my code: and try to adopt it on your code [code]... void clear_kb(void) { char junk[80]; gets(junk); } [/code][/QUOTE] You should really read the thread you are posting in. You would have learned something about [ICODE]gets()[/ICODE]

Member Avatar for Dave Sinkula
1
690
Member Avatar for stevechow

Display each grid you generate and see where the errors occur in the generations. Are you taking into account that the edged of the grid only have 5 neighbors and not 8?

Member Avatar for jonsca
0
139
Member Avatar for Salem

[QUOTE=John A;878497]I've said this already, and I'll say this again: I still think requiring X number of posts before a user can add a signature would work wonders to stopping this crap. But for some reason higher-ups disagree with me. *shrugs*[/QUOTE] So do I. For people like [B]Jen0608 [/B] with …

Member Avatar for Nick Evan
0
257
Member Avatar for chescarleta18

Let's see... No CODE tags, even thought there are at least 6 places they are explained, and 3 of them on the main page alone. No explanation about why code was posted I guess all there is to say is: Congrats for writing some code! What's next?

Member Avatar for chescarleta18
0
107
Member Avatar for neithan

And in C [iCODE]for(unsigned i = 0; i < cantidad_frases; i++)[/iCODE] is illegal. [iCODE]i[/iCODE] must be defined before it is used, not in the [iCODE]for[/iCODE] statement.

Member Avatar for neithan
0
162
Member Avatar for neithan
Member Avatar for Narue
0
191
Member Avatar for j_cart007

Also you are not writing C++ code so all your variable definitions need to be at the top of your functions, [I]before[/I] any executable statements. And for us to follow your code, [url=http://www.gidnetwork.com/b-38.html]use proper formatting[/url]

Member Avatar for j_cart007
0
138
Member Avatar for Ismailworking

[QUOTE=dkalita;1028174]If you are using turbo C then use getch() not getchar(). Its in the header file conio.h.[/QUOTE] Don't listen to [B]dkalite[/B]. [ICODE]getch()[/ICODE] is not standard, [ICODE]getchar()[/ICODE] is. As for your problem, my crystal ball tells me your problem is on line 75 of your code... :icon_confused:

Member Avatar for ankur_
0
10K

The End.