473,749 Members | 2,443 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,405
thread by: Josh Mcfarlane | last post Mar 3 '06 by: Victor Bazarov
What's the best way to serialize and unserialize an enumeration value? Is there a defined size that an enumeration cannot exceed? For example, int size may vary based on computers, so is there a set size that I should use in a binary communication format? Thanks, Josh McFarlane
6
1,850
thread by: michael | last post Mar 3 '06 by: Victor Bazarov
Dear new group members, I need a compile time constant in a class. As far as I know, I can achieve this via class test { // lots of things static const double i = 1.; };
3
1,972
thread by: Larry Beck | last post Mar 3 '06 by: Alf P. Steinbach
Below is a problem I am having with templates. I am trying to use a template to avoid having multiple class methods that differ only in the return type of the pointer. I have tried putting in another parm of the typename to guarantee the uniqueness of the parm list but it didn’t help. I am getting undefined externals from the linker, one for...
3
480
thread by: FUGATO | last post Mar 3 '06 by: CBFalconer
I need to help to wrap up text. I have a line all the text and I need to wrap the text with 40 characters each line but without using function. Somebody help me about that and give me an idea
10
9,781
thread by: free2cric | last post Mar 3 '06 by: stathis gotsis
Hi, I have a single link list which is sorted. structure of which is like typedef struct mylist { int num; struct mylist *next;
3
2,125
thread by: Ninan | last post Mar 3 '06 by: Jack Klein
I am using gcc compiler gcc B.o Main.o -lMyLib //A.h class A { public: A(); void abc ();
2
1,933
thread by: TCM | last post Mar 3 '06 by: Jack Klein
I need to run multiple C files one after the other. My makefile currently looks like this: BINS: a.out b.out c.out d.out run-all: $(BINS) ./(Need each file here, sequentially) I can't find any static pattern match to have them all run one after the other. $? returns all them, I need to parse through them one at a
0
338
thread by: FUGATO | last post Mar 3 '06 by: FUGATO
I need to help in my assignment. I need to wrap a text with the following indications: 1.If you have reached the end of the line (number of characters on this line >= 40) AND you have reached the end of the current word, start a new line and reset the number of characters on the line to 0. The end of a word will be denoted by one of these:...
13
1,647
thread by: pemo | last post Mar 3 '06 by: CBFalconer
Does anyone know how many standard functions there are in the various standard's c99 etc? Thanks -- ============== *Not a pedant* ==============
2
5,863
thread by: aarklon | last post Mar 3 '06 by: CBFalconer
Hi folks , Online C test at: http://www.testyourabilities.com/webui/TestDesktop/Screens/Test.aspx
9
1,669
thread by: silverchrono | last post Mar 3 '06 by: CBFalconer
this is my first semester in C and im trying to figure out how to reset a counter. heres why im trying to do. void text() 59 printf("You can end entering the text by using '#'\n"); 60 int i=0; 61 int j=0;
19
3,324
thread by: ok | last post Mar 3 '06 by: CBFalconer
I came across some variable name like __gc_context. I started thinking a bit if I should tell the author of that code that names starting with underscores are reserved for the implementation. I decided not to because it would make me look like somebody who just wastes other people's time instead of finding real bugs. Come on, how serious...
36
2,659
thread by: Roman Mashak | last post Mar 3 '06 by: Dave Thompson
Hello, All! I implemented simple program to eliminate entry from the file having the following structure (actually it's config file of 'named' DNS package for those who care and know): options { directory "/var/named"; listen-on { 192.168.11.22; 127.0.0.1; }; forwarders { 168.126.63.1; };
19
3,608
thread by: gk245 | last post Mar 3 '06 by: Dave Thompson
I have something like this: printf("Enter numbers: "); scanf ("%i", &number); If the user put in a bunch of numbers (like 4568), instead of just one number, i know that you can extract the right most digit with this: right_number = number % 10; /* print the number */
26
6,713
thread by: robertwessel2 | last post Mar 3 '06 by: Dave Thompson
In another thread, a poster mentioned the Posix ssize_t definition (signed version of size_t). My initial reaction was to wonder what the point of the Posix definition was when ptrdiff_t was already defined as such. I got the idea that ptrdiff_t had to be the same size as size_t from Plauger's "The Standard C Library," where he states "......
16
117,259
thread by: akarui.tomodachi | last post Mar 3 '06 by: Dave Thompson
What is the most easiest way to convert an integer value to ASCII character format ? I tried with sprintf(). It works. Is there any other way to do that ? Objective:: I like to convert an integer value of 3 and write into a string buffer. What I did: .....
40
2,816
thread by: RadiationX | last post Mar 3 '06 by: stathis gotsis
I have a problem that I really don't understand at all. In my previous post I could get started on my projects I just had a few problems with syntax errors. This problem is something that I don't conceptually understand very well. Here it is: Î* – the ratio of the circumference of a circle to its diameter – is one of the most common...
4
1,919
thread by: Amit Limaye | last post Mar 3 '06 by: Amit Limaye
Hello, i have a class with around 10-15 properties and i want to write a single set get pair to access all these properties. Any suggestions. BTW this is not some question for an interview. I was thinking of implementing this in some of the code i have been writing. I was asked this question a couple of years ago and i jumped onto member...
5
5,105
thread by: Angel Tsankov | last post Mar 3 '06 by: Greg
Does the standard define what happens when a NULL pointer is dereferenced? If so, where?
12
2,791
thread by: shyam | last post Mar 3 '06 by: Keith Thompson
Hi all is there any way the determine which function currently is executing in a process ? For example we can find the file name using __FILE__ and line number using __LINE__ macros simillarly is there any macro which gives the function name
4
2,069
thread by: pritisrathi | last post Mar 2 '06 by: Pete Becker
Hi All, I have a union which is a public data member of a class. This union has one anonymous structure. The structure is like : union abc { unsigned char byte; struct { unsigned char rec_ : 5; unsigned char type_ : 2;
4
3,224
thread by: c_beginner | last post Mar 2 '06 by: Keith Thompson
As a mean to improve my C skill for a more of program oriented I started the acm's problem set. In the following code the stdin gets the two inputs but the program does not proceeds further. Please help. The problem link follows: http://acm.uva.es/p/v1/100.html
2
2,065
thread by: Alan Ning | last post Mar 2 '06 by: Marcus Kwok
I have a class that contains a stl vector as a private member. I would like to write an accessor method for this stl vector. However, I don't want to return a whole copy of the vector. What should I do in this case? Right now, I am returning the address of the vector. const vector<> * ReturnVector() const { return m_vector; }; Is this...
7
2,085
thread by: Paolo | last post Mar 2 '06 by: Keith Thompson
Hi all! As I said in the title, I have a very strange problem compiling a program Here's the code that gives the problem: enum letters { a = 0, b, c };
4
286
thread by: ckpradip | last post Mar 2 '06 by: Mark McIntyre
This is my code #include <stdio.h> #include <stdlib.h> int main ( void ) { unsigned char *ptr = ( unsigned char ) 0x00070000; printf ( " %c", *ptr ); /* getting segmentation fault here */

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.