473,544 Members | 1,876 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.
5
1,686
thread by: Naren | last post Nov 13 '05 by: Dan Pop
Hello grp, I have a doubt. This is an example program I have written. May not be useful but just wanted to understand. short int hello(short int *i); main() { short int i=2; i = hello(&i);
5
9,995
thread by: Paul Groth | last post Nov 13 '05 by: Al Bowers
Hi All, Having lots of dramas trying to pass an array of structures to a function. I manage to print to the elemnt of the first structure in the array and then I get a core dump. The code is very simple as I am just experimenting. Can anyone tell me what I am doing wrong. #include <stdio.h> #include <stdlib.h> #include <string.h>
5
1,886
thread by: Chris Saunders | last post Nov 13 '05 by: Dan Pop
I came across a construction in some code I was reading that I have never seen before and hope that someone could tell me how to interpret this: int (*literalScanners)(const ENCODING *, const char *, const char *, const char **); It looks like a function declaration to me but the ""
5
45,633
thread by: Jeong-Gun Lee | last post Nov 13 '05 by: Randy Howard
I'm writing a code of writing a value to a specific memory address. ================================================================= #include <stdio.h> int main() { long air; long *air_address;
5
1,660
thread by: Sumeet | last post Nov 13 '05 by: Jason
I met a question in a test which invoked undefined behaviour and i was asked to answer the Expected answer of the question Specifications := Win98 Os Tc compiler int i=23; i=(i++|++i)^(i++ + ++i); what should be the value of i after this ? is there any way that i can predict the answer ? Also i don't have a good understanding of the...
5
3,482
thread by: j | last post Nov 13 '05 by: Richard Heathfield
Anyone here feel that "global variables" is misleading for variables whose scope is file scope? "global" seems to imply global visibility, while this isn't true for variables whose scope is file scope. If you have a variable whose scope is file scope in another translation unit, you have to provide a local declaration to access that variable...
5
9,111
thread by: Jason | last post Nov 13 '05 by: Richard Heathfield
How do you access an int pointer inside a struct. This is how it seems like it would work to me, but it doesn't... struct maze { int num; int * roomnum; }; void setmaze(struct maze * maze) { maze->num = 1; //this is equivelant to: (*maze).num = 1
5
6,106
thread by: Subrahmanyam Arya | last post Nov 13 '05 by: Richard Bos
Hi Folks , I am trying to solve the problem of reading the numbers correctly from a serial line into an intel pentium processor machine . I am reading 1 byte and 2byte data both positive and negative quantities . Can any one tell me what are the things i should bear in mind .
5
3,719
thread by: Gustavo Rondina | last post Nov 13 '05 by: goose
Hi all, I would like to know if someone have sites, howtos, papers ... any documentation about writing applications in C that comunicates with the PC thru the USB interface. Any documentation will be welcome and some examples as well, if possible. Cheers,
5
3,845
thread by: aneesh | last post Nov 13 '05 by: j
Hi all, I have a program, this works fine but if we declare static below "int i" it shows different storage class specifier. what will be the reason. #include <stdlib.h> static int i ; int i; int main()
5
1,796
thread by: Tushar | last post Nov 13 '05 by: Dan Pop
hello all, i would like to know why this code compiles and gives the output Code 1: ---------- int main(){ printf("String" + 2); }
5
8,793
thread by: Emmanuel Delahaye | last post Nov 13 '05 by: Dan Pop
Hi, I know that C90 and C9x (N869) doesn't allow to define an array of size 0. int x; /* constraint violation */ I was under the impression that this was possible in C99, due to the common C90 practice: struct a
5
4,543
thread by: herrcho | last post Nov 13 '05 by: bd
here is the code #include <stdio.h> int main() { char *str1="Borland International"; printf("%d\n", strlen(str1)); return 0; }
5
1,734
thread by: Ofloo | last post Nov 13 '05 by: Derk Gwen
I would like to make an exe that parses the given info behind a exe to a txt anyone who can confirm this don't know why but the thing just freezes ?? 0 errors on compile ? // start source code <filename sparse.ccp> // writing on a text file #include <fstream.h>
5
5,284
thread by: nimdez | last post Nov 13 '05 by: Roger Willcocks
Hi, I am working on an existing code base in which a lot of data displayed to the user is formatted in tables. Most tables are printed row-by-row using printf() with "%s" print conversion specification for each column (e.g. printf(%10s %25s %15s\n", pszCol1, pszCol2, pszCol3)). My problem is that when a string is longer the column's width,...
5
4,204
thread by: Koen | last post Nov 13 '05 by: Koen
Hi, I am looking for an algorithm that figures out which numbers from a given set add up to another number. I am sure this has been done before, but I have no idea how such a calculation is called, which kind of limits my further searching. An example. The set contains the numbers 1-2-3-4-5. Now the algorithm should calculate all...
5
1,925
thread by: Nikos Chantziaras | last post Nov 13 '05 by: Malcolm
What's the best way to allow the compiler to inline a function in C? (Not C99, which already supports the 'inline' keyword.) The way I do it, is to define the functions in question as 'static' in a header file: static void foo() { /* ... */ }
5
19,780
thread by: Abby | last post Nov 13 '05 by: James Antill
Hi, I've got the following ... char user = "root"; unsigned long session = 0x0012453b; char result; How can I concatenate user and session to result? Thank you.
5
2,516
thread by: Dopey | last post Nov 13 '05 by: pete
This is not homework. I'm trying to understand why this code doesn't output "$$$$$$$\0\n" -- all I get is "$)\n". (I admit I'm an idiot, OK?) #include <stdio.h> #include <stdlib.h> struct mystruct {
5
4,814
thread by: Danny | last post Nov 13 '05 by: CBFalconer
Hi, I am writing a C program trying to read highlighted text in aother application (Acrobat Reader or Microsoft Office). How do I find out which application is on focus and grab the text highlighted? Thanks. Danny
5
2,260
thread by: Digital Khaos | last post Nov 13 '05 by: Keith Thompson
Hello all, I've been watching the group now for a bit, and I'm still not sure if this question is relelvent to this group, but here goes anyway: The following code: #include <stdio.h> #include <stdlib.h>
5
2,202
thread by: Blankdraw | last post Nov 13 '05 by: Blankdraw
I can't get this nested loop to break the outer loop at the 5th data value so control can proceed to the next array col and continue pigeon-holing the next 5 in its own column. Why can I not get this nested loop to make sense? This is the last holdup to completion of my silly project. Explaining it from the inside - out, I want to fill a...
5
3,943
thread by: Fogus | last post Nov 13 '05 by: Mike Wahler
I have written a portable chess program using ANSI C, however at the moment my 'console' display is quite ugly. It currently uses rote printfs to output a page at a time of the board as well as other useful information. These pages simply scroll one after the other. However, in reality a better solution would be to (at minimum) clear the...
5
795
thread by: Abe Simpson | last post Nov 13 '05 by: Eric Sosman
Hello all, The application I am working on must never output numbers in a floating-point format, that is, something like 2e-002 is a big no-no. At the same time, it must output numbers in a compact way, that is, it should only output significant digits, and only output a decimal point if there are digits following it.
5
1,368
thread by: Cadderly | last post Nov 13 '05 by: Cadderly
Hi, Could you explain why the outputs of the 2 'for' are the same? Thanks #include <stdio.h> int main(void) { int i; for ( i = 0; i < 5; i++ ) {

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.