473,544 Members | 801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C / C++ Forum

C / C++ programming language - Get answers to questions about compilers, visual C++, templates, namespaces, classes, data structures, OOP (object-oriented programming), inheritance, data types, exceptions, Standard Template Library (STL) and the C Standard Library.
3
2,445
thread by: Yan Yang | last post Nov 13 '05 by: August Derleth
Hi, I have a program and I want to test its execution time. When I run the program, I can feel it runs about 4 mins, but the gprof only says the accumlated time is 7.2 secs. Then I use the command: "date; my program; date" and from the time difference, I got the time 287 seconds? I am really confused about these two numbers. Why gprof...
15
2,445
thread by: kernel.lover | last post Nov 14 '05 by: CBFalconer
Hello, i want to know to have multiple clients connects to same server program does following is correct code #include <sys/types.h> #include <sys/socket.h> #include <stdio.h> #include <netinet/in.h> #include <signal.h> #include <unistd.h>
8
2,445
thread by: shyju_kambi | last post Nov 15 '05 by: Mabden
when a 'const int ' is declared, where is it been created(in RAM?) #include<stdio.h> int main() { const int i=10; const int *p; p=&i; *p=12; printf("\n %d %d",i,*p);
3
2,445
thread by: Shivani | last post Nov 15 '05 by: Joe Wright
Hi, I am looking for a utility that reads hexadecimal numbers from a file into a string. The numbers in the file are seperated by "," as delimeter. Is there a standard C utility that can do that? I am trying to read the hexadecimal numbers and trying to write this to a buffer in binary format. To do so, I am reading the numbers in a string...
3
2,445
thread by: Levi Campbell | last post Feb 11 '06 by: Flash Gordon
Hi, I'm trying to debug an app someone else wrote called eMixer. Here's the log contents: cc -O3 -funroll-loops -c -o main.o main.c cc -O3 -funroll-loops -c -o nctgui.o nctgui.c cc -O3 -funroll-loops -c -o mixer.o mixer.c mixer.c: In function `open_soundcard_alsa':
1
2,445
thread by: craig | last post Mar 22 '06 by: Phlip
I'm trying to construct a PAC-agent architecture for an application that has an MDI GUI. I'm structuring the mainWindow as the presentation of the top-level agent. Sub-agents of the top-level are "document editors". The top-level mainWindow contains menus for top level functions, as well as menu items for the active sub-agent (document...
12
2,445
thread by: Daz | last post May 11 '06 by: Joe Van Dyk
Hi everyone. I am not sure of where best to post this message. I have spent 2 days now trying to answer this question to no avail, and I am gradually reaching the end of my tether. I am trying to figure out how to: see if a directory exists (using the whole path, not a folder in the current directory). if not, make the director( y | ies )
10
2,445
thread by: Jim Langston | last post May 15 '06 by: Richard Herring
Expected output of program: Key is: 0 String is: Hello Key is: 1 String is: Goodbye Key is: 2 String is: The end Actual output: Key is: 0 String is: The End Key is: 1 String is: Key is: 2 String is:
10
2,445
thread by: DaVinci | last post Sep 3 '06 by: Eric Sosman
Is #define STREQL(x,y) ((*x == *y)&&(strcmp((x),(y))==0)) is bettern than STREQL(x,y) (strcmp((x),(y))==0).why?
11
2,445
thread by: Hallvard B Furuseth | last post Oct 3 '06 by: Hallvard B Furuseth
I've been wondering sometimes: Anyone know why Duff's device is usually written like this: void duff(const char *str, int len) { int n = (len + 7) / 8; switch (len % 8) { case 0: do{ foo(*str++); case 7: foo(*str++); case 6: foo(*str++); ...
4
2,445
thread by: ChipAuger | last post Oct 24 '07 by: James Kanze
Hello Group, Thank you in advance to the group for all responses and help. I'm looking for a 1-way hash for storing passwords on an older embedded system that would be computationally stressed using SHA1. Does anyone have any suggestions? Thanks again, Chip Auger
0
2,445
thread by: vlsidesign | last post Jan 28 '08 by: vlsidesign
I am a newbie to C, and was hoping to get a little bit better handle on this until I get deeper into pointers, etc. I kind of understand it some, but still unfamiliar because I haven't got to pointers and using them yet. Here is my program: #include <stdio.h> int main() { char yourname; int yourworth;
4
2,445
thread by: apa | last post Feb 26 '08 by: edwardrsmith
What is the proper way of assigning null pointers in runtime. If I do the following: struct list *s=malloc(sizeof(list)); free(s); s=NULL; the program will work but Valgrind will give a complaint "Invalid write of size 4". Cheers, Antti
5
2,445
thread by: coleslaw01 | last post Mar 7 '08 by: MACKTEK
Hello, I am trying to teach myself C++ while babysitting a stable network in Iraq and have put together a program to display the fibonacci sequence. It works with long and long double(output in exponent though) After sequence 47 using long type the program won't display the output properly (I am assuming because of size limit of type) so I...
5
2,445
thread by: Ravindra.B | last post Aug 6 '08 by: santosh
I tried checking internet status of my system by issuing ping to some well known server like google.com. But, the problem is that ping is not working if target address is not within the same network. I actually started writing small application, which can tell the internet status of the given system by using some standard network Apis. It...
13
2,446
thread by: C++fan | last post Jul 22 '05 by: Cy Edmunds
The following code is for list operation. But I can not understand. Could anyone explain the code for me? /* * List definitions. */ #define LIST_HEAD(name, type) struct name { type *lh_first; /* first element */
1
2,446
thread by: Mario Viertel | last post Jul 22 '05 by: Shiju Rajan
Hi, I have a Problem with the following Code: //IDL typedef sequence<float> FloatSeq; struct MyStruct { FloatSeq fs; };
6
2,446
thread by: kak3012 | last post Jul 22 '05 by: red floyd
Hi all, I am trying to make a sinusoidal curve fit by using Levenberg-Marquardt Method with numerical recipies. I have model the my function which is y=Ao+C1.cos(x+phase) as at the end of this message. From that point on I am confused about what to do. I know I need to use mrqcof function but could not figure it out how to use use it...
7
2,446
thread by: Full Decent | last post Aug 7 '05 by: Victor Bazarov
aclass A, B; Can A access B's privates all the time, or only in a copy constructor? -------and--------- This code: #include <iostream> class A
6
2,446
thread by: Jon | last post Nov 13 '05 by: LibraryUser
using Borland Compiler. x = "this is a string" strcat(x,x) strcat(x,x) will produce "this is a stringthis is a stringthis is a stringthis is a stringt"
8
2,446
thread by: Servé Lau | last post Nov 14 '05 by: pete
Sometimes I code like this: char *p = strchr(buf,'\n'); if (p) *p = 0; But I've also seen the shorter expression: buf = 0;
2
2,446
thread by: Cris Ding | last post Nov 14 '05 by: Mark McIntyre
Hi, everyone, Suppose the following simple program: #include "engine.h" int main() { Engine *ep;
11
2,446
thread by: yezi | last post Dec 2 '05 by: Niklas Norrthon
Hi: all: is some mem cat function with is like "strcat" ? Thanks
8
2,446
thread by: Alex Fraser | last post Mar 8 '06 by: Joe Wright
Can negating a non-negative signed integer value ever overflow? Put another way, can it be true that (mathematically) INT_MIN > -INT_MAX, LONG_MIN > -LONG_MAX etc? I know that typically it can't overflow, but if that isn't guaranteed, how can I portably detect if it would? Alex
3
2,446
thread by: Martin Joergensen | last post May 1 '06 by: Michael Brennan
Hi, Just a small problem (about taken the previous unsigned value in a 1D- array and copying it to the current value). Suppose there's an outer loop over the line shown below, so unsigned_int_ptr keeps changing, as it is a parameter in the function called function( &array ).... void function( unsigned *unsigned_int_ptr)

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.