5,237 Posted Topics

Member Avatar for lewisy

Does this even compile? > return status; I see no status declared anywhere. > CA2CT mailHostConverted(mailHost.c_str()); This looks like it's stuck half way between a function prototype and a function call. > conn.Connect(mailHostConverted); I imagine this returns a status, why not test that to see whether the connect failed or …

Member Avatar for Salem
0
132
Member Avatar for saman

> So better keep in mind that if the file is not present a new one with the same name will be created. Not if you're opening it for reading it won't.

Member Avatar for ~s.o.s~
0
199
Member Avatar for Blitzer

Well you can create a short string with [code] char s[2]; s[0] = ch; s[1] = '\0'; [/code] Then pass that to atoi, though strtol etc are better long term bets. A quick answer is to do [code]intVal = ch - '0';[/code]

Member Avatar for ~s.o.s~
0
182
Member Avatar for rollbamaroll316

[url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] The first step would be to create a program which allows you to input a team / player, and print the information back to the user. Until that works, there is no point trying anything else.

Member Avatar for Salem
0
111
Member Avatar for CyberLev

Please format your code [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] Colourful, but variable spaced and unindented - bad. Monochrome, fixed width and indented - good.

Member Avatar for CyberLev
0
107
Member Avatar for chethanasrao

[code] NAME ftw, nftw - file tree walk SYNOPSIS #include <ftw.h> int ftw(const char *dir, int (*fn)(const char *file, const struct stat *sb, int flag), int nopenfd); [/code]

Member Avatar for Salem
0
89
Member Avatar for dilip.mathews

> The reason for this error might be that I am not allocating any memory for the pointer(correct me if I am wrong). Yes, it has been allocated, but the memory which you're pointing at is read-only (meaning you can't change it). The variable p can be changed (say p="world"), …

Member Avatar for dilip.mathews
0
268
Member Avatar for wingwarp

If this is your first foray into graphics, you might want to get the libsdl devpack installed as well. [url]http://www.libsdl.org/index.php[/url] The 's' is for "Simple"

Member Avatar for Salem
0
310
Member Avatar for slacke

> while(charbuff[i]!=' ') Maybe this is false on the first iteration, therefore i never gets modified and the function exits without doing anything. > ........... some code Post COMPLETE whole programs which show the problem. Most efforts to snip out "irrelevant" code usually end up snipping out something really vital …

Member Avatar for slacke
0
167
Member Avatar for gampalu

> fscanf( fINPUT, "%s", &IP_name[j]); > printf("%s\n", &IP_name[j]); You're still using & where you shouldn't (on both of them). Gah - beaten

Member Avatar for gampalu
0
207
Member Avatar for aholliker
Member Avatar for ShawnCplus
0
105
Member Avatar for joshilay

> can anyone explain me why the values are not swapped in the below code ?? Another problem is that your pointers are uninitialised - who knows, maybe they both point at the same memory location.

Member Avatar for Salem
0
277
Member Avatar for Tlhokomelo

> # define EOF =-1 You should really have [inlinecode]#include <stdio.h>[/inlinecode]

Member Avatar for Salem
0
103
Member Avatar for blewis999

[url]http://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html[/url] Build up your own little graphics library of functions which you can call from the rest of your application. Once you've mastered something like putPixel(), the rest should be pretty easy.

Member Avatar for Salem
0
106
Member Avatar for chillharsh

> ya thaxs it works Rather too easy to break IMO [code] #include <stdio.h> int swap ( int *a, int *b ) { *a ^= *b; *b ^= *a; *a ^= *b; } int main(void) { int a = 2, b = 3; printf( "%d %d\n", a, b ); swap( …

Member Avatar for sukhi
0
480
Member Avatar for amitkumar2982

Have a long hard read - [url]http://www.nondot.org/sabre/os/articles[/url]

Member Avatar for Dave Sinkula
0
238
Member Avatar for joshilay

I agree with Ancient Dragon, the code is broken. You basically have variations of the problems listed here [url]http://c-faq.com/expr/index.html[/url]

Member Avatar for joshilay
0
193
Member Avatar for dilip.mathews

Yes, you find the manual / help pages which describe the string class. This will detail the public interface to the class. Say perhaps [code]string foo; foo.length();[/code]

Member Avatar for Narue
0
123
Member Avatar for ostkaka

> and i wonder if anyone can tell me what´s wrong with this code Posting error messages helps. > end1; In your case, I guess you mean endl That's lower-case "L" (l) at the end, not numeric one(1).

Member Avatar for dilip.mathews
0
79
Member Avatar for geethanjali_t
Member Avatar for Salem
0
47
Member Avatar for winbatch

[url]http://www.cplusplus.com/ref/iostream/istream/getline.html[/url] getline allows you to specify a delimiter of your choice, if it's a single char.

Member Avatar for Ancient Dragon
1
221
Member Avatar for amethystglow

[url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] Then do things like - count opening and closing braces - look for missing ; (or indeed as in your case, mis-placed ; )

Member Avatar for Salem
0
145
Member Avatar for HelmsK85

[url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url]

Member Avatar for Dave Sinkula
0
205
Member Avatar for binteron

> car *ptr = &catalogue[0]; What does this achieve? You can do this [inlinecode]cin.getline(catalogue[i].make,20);[/inlinecode] > delete [] catalogue; You need to do this after you've finished printing the data, not before. > however on the first run through the loop, the "make" of the car is not stored in the …

Member Avatar for binteron
0
164
Member Avatar for HelmsK85

> [inlinecode]array[i+1] *= array[i] ; [/inlinecode] Since this is just short for [inlinecode]array[i+1] = array[i+1] * array[i] ; [/inlinecode] All the calculations involve undefined values because i+1 element is read before being written (in the absense of any other initialisation).

Member Avatar for Salem
0
127
Member Avatar for rhp405

> It waits only process number 1, and not number 2. Why? Because you asked it to. If you use -1 as the pid, then it will wait for any child, and return with the pid of the child which ended. Put that into a loop until all your children …

Member Avatar for rhp405
0
2K
Member Avatar for bibo1978

Start by stating what the problem is you're trying to solve rather than imagining using strstream is the answer. Tell us the problem you're trying to solve, not how to fix your solution. Have you considered for example a vector of unsigned chars for storing your binary data? > but …

Member Avatar for bibo1978
0
246
Member Avatar for Nedals

Like [code] #include <iostream> #include <string> using namespace std; struct record { string C[3]; }; int main() { record param; param.C[0] = "heading1"; param.C[1] = "heading2"; param.C[2] = "heading3"; int key = 0; string data = param.C[key]; cout << "DATA: " << data << endl; return 0; // zero is …

Member Avatar for Nedals
0
205
Member Avatar for server_crash

> but there's specific reasons why I was wanting to compile and run under Miracle C. Because you're a masochist? Like Dave said, Miracle C is a silly PoS compiler which looks great if your homework was "write a C compiler", but is utterly useless for anything more complicated than …

Member Avatar for WolfPack
0
850
Member Avatar for ds_matrix

> char temp[81]=""; But apparently your words are up to 1000 characters long. Fix this, or fix your arrays. > y[1000][1000] 1MB of unused space, just get rid of it. It seems to me that you're likely to be blowing away your entire stack (and much more) before you've even …

Member Avatar for Rashakil Fol
0
121
Member Avatar for angle188.shroff

What about your source code, does it include windows.h before including any other windows header file?

Member Avatar for Dave Sinkula
0
474
Member Avatar for CharlesTeck

> but the memory that was used is not freed up If you worked this out by watching task monitor or process explorer, then it wouldn't. The program memory manager usually holds onto the memory for future memory requests from your program (which is relatively quick), rather than asking the …

Member Avatar for Salem
0
192
Member Avatar for startspark9

> call to function 'Printf' with no prototype in function main" Or maybe check the spelling. C is case sensitive, so Printf is not the same as printf

Member Avatar for John A
0
154
Member Avatar for molayos

Well either you do it all yourself by reading [url]http://beej.us/guide/bgnet/[/url] - to learn basic network programming [url]http://www.rfc-editor.org/[/url] - to learn about the protocols which interest you Or get a library to do a bunch of stuff for you, eg. [url]http://curl.haxx.se/[/url]

Member Avatar for Salem
0
109
Member Avatar for Omher

> Elapse Time Since Program Start Working What do you mean? The amount of time, as measured by the clock on the wall? The amount of time the program has used? If your program is low priority, say it's only using 10% of the CPU, there is a big difference …

Member Avatar for dev.cplusplus
0
440
Member Avatar for Vada

[url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] And [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url]

Member Avatar for server_crash
0
209
Member Avatar for LieAfterLie

[code] int* fn0() {int solution[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …

Member Avatar for AhmedHan
0
435
Member Avatar for Joncamp

[url]http://www.faqs.org/docs/securing/chap29sec254.html[/url] Are you entirely sure that apache is seeing the same directory structure that you're seeing? Which real / effective user ID's is apache running with, and do these have appropriate permissions to access the files? Create a simple C++ program which allows you to log all this information, and …

Member Avatar for Joncamp
0
117
Member Avatar for luckycharms3657

Please annotate your code listing with some comment indicating [code]// This line causes this error // vector<int>::vector(const int, const int, const int)' [/code]

Member Avatar for Salem
0
88
Member Avatar for Phaelax
Member Avatar for dude543

> 1) If we have a filed in the struct which his value is known to us Seems good to me - no extra storage needed, like working out how to allocate a big enough array of pointers. Also, checking time increases with the length of the list. Call the …

Member Avatar for dude543
0
143
Member Avatar for gampalu

What does SetMaxColRow() actually do? If you just construct and destruct this object in a test program, does it still crash? Have you looked at what other things are doing elsewhere? Just because it crashes here doesn't mean the problem is here, when dealing with dynamic memory.

Member Avatar for Salem
0
358
Member Avatar for playkid

Ever heard of google? [url]http://www.google.co.uk/search?q=malloc[/url] Ever bothered to read threads on the same page with malloc in the title? [url]http://www.daniweb.com/techtalkforums/thread46636.html[/url]

Member Avatar for yuzhang
0
236
Member Avatar for pench

new is C++ malloc and calloc are C calloc is the same as malloc, except for it clears memory to all bits zero. new causes constructors to be called, malloc does not.

Member Avatar for SpS
0
624
Member Avatar for jazzz

C'mon, you could have at least posted your most recent attempt at the code [url]http://forums.devshed.com/c-programming-42/sorting-356010.html[/url] This post here is nearly an hour newer than your reply to my original comments, yet it's the old code.

Member Avatar for jazzz
0
117
Member Avatar for Dashing Boy

> void main (void) main returns an int > int a,ab[5,2],ad[5],b; A 2D array would be [inlinecode]int ab[5][2];[/inlinecode] Likewise, accessing it would be [inlinecode]scanf("%d",&ab[a][0]);[/inlinecode]

Member Avatar for Dashing Boy
0
129
Member Avatar for lchamarthi

Which compiler (and which version)? Which version of windows? [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp[/url] Scroll down to "Communications Resources"

Member Avatar for Salem
0
167
Member Avatar for mmiikkee12

[url]http://c-faq.com/struct/padding.html[/url] How you specify a packed structure depends on your compiler.

Member Avatar for Salem
0
147
Member Avatar for geez85

> double variable[1000][1000] = { 0 }; In other words, about 8MB in size. You're basically blowing away the stack, which depending on your machine could be as little as say 16K in size. Depending on your compiler, you can specify the initial stack size as being something else. Since …

Member Avatar for dubeyprateek
1
4K
Member Avatar for ontrix

Well you could state your OS and compiler. There is no standard way to achieve sub-second delays.

Member Avatar for Ancient Dragon
0
398

The End.