1,494 Posted Topics

Member Avatar for goldman480

Maybe you can start by giving us the basics...Does it compile error/waring free? If not which errors and warnings are generated? Is it a run time problem? If so what's the problem? We need more than 'is not running anymore'.

Member Avatar for jonsca
0
168
Member Avatar for moroccanplaya
Member Avatar for gerard4143
0
165
Member Avatar for SDH1

After I include cstdio the program compiled and ran as expected..Actaully line 33 in your program might be incorrect. Your passing the address of dwArg to create thread which is changing as the loop iterates, this is probably what's causing the weird nummbers.

Member Avatar for Narue
0
104
Member Avatar for zachman1094

Check this out [code] Broken-down time is stored in the structure tm which is defined in <time.h> as follows: struct tm { int tm_sec; /* seconds */ int tm_min; /* minutes */ int tm_hour; /* hours */ int tm_mday; /* day of the month */ int tm_mon; /* month */ …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for mbouster

Your going about this the wrong way. Customers member function 'showCustomers' shouldn't loop through the Customers objects, it should only display its values. You should have a loop like [code] for (int i = 0; i < 150; ++i) { CustArray[i].showCustomers(); } [/code]

Member Avatar for mbouster
0
2K
Member Avatar for jeffpro

Your Hi variable [code] char Hi[4] = {'3','E','2','C'}; [/code] is four bytes with the values of(in ascii) 0x33 = '3' 0x45 = 'E' 0x32 = '2' 0x43 = 'C' and this (in ascii) [code] Bye[0] = 0x3E and Bye[1] = 0x2C [/code] would equate to [code] Bye[0] = '>' and …

Member Avatar for gerard4143
0
97
Member Avatar for gth759k

You should get into the habit of initializing data member like so [code] Vector::Vector () :x = 0,y = 0,z = 0 {} Vector::Vector (float a, float b, float c) :x = a,y = b,z = c {} [/code] In some situations its more efficient.

Member Avatar for gerard4143
0
3K
Member Avatar for Akill10
Member Avatar for indr

If your going to increment your pointer then save its original value somewhere and delete that.

Member Avatar for indr
0
164
Member Avatar for knotholaze

Try working with setprecision like below [code] #include<iostream> #include <iomanip> int main() { double my_f = 1.0/3.0 / 30.0; std::cout << my_f << std::endl; std::cout << std::setprecision (100) << my_f << std::endl; } [/code]

Member Avatar for knotholaze
0
108
Member Avatar for iwanttolearnc

Line 19...Why are you closing write here? actually line 16...Why are you opening write here? Try looking at the code below [code] #include <stdio.h> #include <stdlib.h> #define BSIZE 24 int main() { char ch[BSIZE]; FILE *fout; FILE *fin; if (!(fin = fopen("testfile", "r"))) { fputs("could not open testfile!\n", stderr); exit(EXIT_FAILURE); …

Member Avatar for iwanttolearnc
0
217
Member Avatar for salvador01

Try working with the modulus operator...Like below [code] #include <stdio.h> int main(int argc, char**argv) { fprintf(stdout, "%d\n", 12345 % 10); fprintf(stdout, "%d\n", 12345 % 100); fprintf(stdout, "%d\n", 12345 % 1000); return 0; } [/code] This should give you a good start...

Member Avatar for sharathg.satya
0
104
Member Avatar for arlir

Your created an array of structures struct secguard guard_rec[300]; So to access one element of your array you must use an array index like gets(guard_rec[0].first_name); Oh by the way the use of gets is really frowned upon...really. Here's why BUGS Never use gets(). Because it is impossible to tell without …

Member Avatar for gerard4143
0
153
Member Avatar for ambageo

Instead of having a function that removes duplicates, why not design the linked list functionality so that it will not accept duplicates..e.g. inserting a new node that results in a duplicate will do nothing.

Member Avatar for ambageo
0
191
Member Avatar for aplh_ucsc

Does your file have a main function? Plus could you post your compile line or makefile?

Member Avatar for gerard4143
0
81
Member Avatar for jagaur
Member Avatar for WaltP
0
196
Member Avatar for shanki himanshu

[QUOTE=shanki himanshu;1426436]@kamatari..not yet..!!! bt i am thinking of making a game and it will surely take time. our teachers has informed us about dis project at the last moment.[/QUOTE] If the teachers dumped this project on the class 'at the last moment' then I expect the class and yourself will …

Member Avatar for Kamatari
-8
134
Member Avatar for shri007

GCC's linker supports alternate entry point names ld - The GNU linker -e entry --entry=entry Use entry as the explicit symbol for beginning execution of your program, rather than the default entry point. If there is no symbol named entry, the linker will try to parse entry as a number, …

Member Avatar for Nick Evan
0
126
Member Avatar for onus

Which one are you talking about? I tried compiling your program and got several warnings and errors.e.g [code] gcc testc.c -Wall -ansi -pedantic -o testc.c testc.c: In function ‘main’: testc.c:12: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[20]’ testc.c:13: warning: format ‘%s’ expects type …

Member Avatar for lvl99
0
387
Member Avatar for VernonDozier
Member Avatar for Kanoisa
Member Avatar for dan76

Just a point...Is it a good idea to call your thread array main[]; Also.. [code] int x[50]; int y[50]; void *run(void *i) { int trial = (int)i; int mode; int Xcor[50]; int Ycor[50]; while (trial!=10) { mode = rand() % 50; x[trial]=Xcor[mode]; y[trial]=Ycor[mode]; } pthread_exit(NULL); } [/code] Your accessing the …

Member Avatar for myk45
0
219
Member Avatar for Azar Mohamed

Mysql has this great site with all this info and tuorials [url]http://zetcode.com/tutorials/mysqlcapitutorial/[/url]

Member Avatar for gerard4143
0
84
Member Avatar for lochnessmonster
Member Avatar for NathanOliver
0
118
Member Avatar for AmerJamil

I would use the functions toupper or tolower to make your code portable. [code] int ans = toupper(val); if (ans == val) { /*is upper case*/ } else { /*is lower case*/ } [/code]

Member Avatar for WaltP
-2
478
Member Avatar for m1n1m3

I didn't read your post in its entirety but I can inform you about this...On Intel/AMD machines the smallest addressable memory is a byte. If you have to work with bits they are not directly addressable so you have to use masking operations to access them...e.g. You can't point a …

Member Avatar for Narue
0
161
Member Avatar for JDevelop

Here's the output from my computer Parent Writing [0]... Parent Writing [1]... hello there Parent Writing [2]... Parent Writing [3]... Parent Writing [4]... Parent Writing [5]... Parent Writing [6]... Parent Writing [7]... Parent Writing [8]... Parent Writing [9]... [gerard@localhost test]$ hello there hello there hello there hello there hello there …

Member Avatar for JDevelop
0
168
Member Avatar for lelejau

Why would you want to translate something that's hard wired to a specific address? typedef void (*t_ChatPrint) ( char * ); t_ChatPrint ChatPrint = (t_ChatPrint)0x0054E410; Your function pointer ChatPrint is hard wired to 0x0054E410.. Can I ask you a question? Why are you translating code when you don't even know …

Member Avatar for lelejau
0
116
Member Avatar for gerard4143

Hi, Is there ever a situation where the programmer needs to be concerned about the copying of a vtable pointer or can I happily assume that the C++ language will handle that detail correctly without my intervention?

Member Avatar for gerard4143
0
219
Member Avatar for Loc
Member Avatar for Trepach
0
113
Member Avatar for Mona..

[QUOTE=neemo6;1420345]Is there a toUpper or toLower in C/++ ?[/QUOTE] The ctype.h library has functions int toupper(int c); int tolower(int c);

Member Avatar for Narue
0
203
Member Avatar for Snehamathur

"warning: incompatible implicit declaration of built-in function 'malloc'" Are you including stdlib.h?

Member Avatar for Narue
0
114
Member Avatar for atoklas

You could try a union with a packed structure..If you using MS you'll have to Google to find out how to pack a structure... [code] #include <stdio.h> union mu { int x; struct { unsigned int a:8; unsigned int b:24; }__attribute__((packed)) in; }; int main(void) { union mu theu; theu.x …

Member Avatar for Trentacle
0
260
Member Avatar for hao90

I would look at two for loops [code] for (int i 0; i < x; ++i) { for (int j = 0; j < y; ++j) { } } [/code]

Member Avatar for hao90
0
103
Member Avatar for christos312
Member Avatar for christos312
0
154
Member Avatar for helpfullProgram
Member Avatar for Narue
0
199
Member Avatar for shinsengumi

I'm not sure what your trying to accomplish here...Are you try to create a unique socket API for both Windows and Linux? Oh by the way, your Linux function is lacking..What does it return if its successful?

Member Avatar for shinsengumi
0
480
Member Avatar for rgutierrez1014

If your using GNU's compiler then the compile should be g++ source.cpp -o executable_name The errors your receiving indicate that you have two main functions...GNU reduces the main function to _start.

Member Avatar for gerard4143
0
191
Member Avatar for vedro-compota
Member Avatar for vadalaz

This might be your problem... On line 14 your freeing Curr and then on line 16 you set Prev to Curr...Prev now equals NULL.

Member Avatar for vadalaz
0
113
Member Avatar for aria12

Are these supposed to be floats? float Place_Of_Birth; float Email_Address; It makes more sense to have it as char Place_Of_Birth[45]; char Email_Address[45]; Your scanf is incorrect here scanf ("%c",&Name); You need to scan for a c-string scanf ("%s",Name); These lines are wrong.. scanf ("%s",&Place_Of_Birth); scanf ("%s",&Email_Address); should be scanf ("%s",Place_Of_Birth); …

Member Avatar for gerard4143
0
116
Member Avatar for lochnessmonster

[QUOTE=lochnessmonster;1414576]so....would a program compiled on a 64bit pc not work for a 32 bit pc?[/QUOTE] That really depends since you can create 32 bit PC programs with 64 bit PC compilers.

Member Avatar for gerard4143
0
194
Member Avatar for techie929

Here's an example to look at. A note the function modifies the original string so it my not be appropriate for your assignment. [code] #include <stdio.h> #include <stdlib.h> #include <string.h> char ca[] = "this is the string to tryout on our reverser"; void myfunc(char *s) { int i = 0; …

Member Avatar for gerard4143
0
135
Member Avatar for yuri1969
Member Avatar for moroccanplaya

Yeah you might want keep input as a c-string and use strcmp for your comparisons.

Member Avatar for Shankye
0
150
Member Avatar for frankchester

Try the code below [code] #include <stdio.h> int main() { int x = 67; fprintf(stdout, "c->%c\n", (char)x); fprintf(stdout, "c->%c\n", x); return 0; } [/code]

Member Avatar for bambrah jai
0
160
Member Avatar for Tellalca

Try writing your code like this...please note that I write to the file and then close and then open for input. [code] #include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main() { ofstream file1("test"); int random = rand() % 100; cout << random << endl; file1.write((char *)&random, sizeof(int)); …

Member Avatar for Tellalca
0
158
Member Avatar for MairiRobertson

I use neither! I use Gedit for C programming and Kdevelop for C++....Why? IMHO, Kdevelop is the best/simplest IDE out there. Plus I really appreciate Kdevelop's code completion algorithm.

Member Avatar for mike_2000_17
0
163
Member Avatar for +_+man

[QUOTE=+_+man;1348762][COLOR="Red"][U]Need Help Making Keylogger[/U][/COLOR] Hi everyone, My name is hayzam and i want to make an advanced keylogger and what to put it in a USB So when I connect my usb it will open automatically and it must be invisible one more thing i am a newbie to C++ …

Member Avatar for bhanumaurya
0
382
Member Avatar for TGeorge824

You might not like the previous posting but its accurate...Your using a pointer that's pointing to nothing.. [code] int main() { process *p;/*this points to nothing*/ p->pid = 1; p->reference_string = "000111222"; [/code]

Member Avatar for gerard4143
0
848

The End.