ansi

How do command-line interpreters work?

I have been under the impression that processes on the operating system have three standard streams: stdin, stdout, and stderr. I have also thought that text editors like vim work by taking input over stdin and sending ANSI escape characters over stdout. However, my view of how command-line interpreters isn't holding up in this one case:...

Standard C header for ANSI VT100 escape sequences

Is there a standard C header containing ansi escape sequences for say vt100 ? ...

store object in an array using ansi c?

I make a structure just like struct abc { //any function or variable } obje[20]; now I want that the each object of abc store in array. means that arr[0] contain obj[0] only; can it is possible. if it is possible then some one help me in this matter. ...

SQL Joins: Future of the SQL ANSI Standard (where vs join)?

We are developing ETL jobs and our consultant have been using "old style" SQL when joining tables select a.attr1, b.attr1 from table1 a, table2 b where a.attr2 = b.attr2 instead of using inner join clausule select a.attr1, b.attr1 from table1 as a inner join table2 as b on a.attr2 = b.attr2 My question is that in the long run, i...

Problem with IDL syntax for ANSI C

I am working on trying to pass data from one ANSI C program to another through RPC. The data that I need to send is currently being stored in a struct as an 'int **m' (a matrix). When I try to write out the IDL file and compile it with 'rpcgen -C -Sc myfile.x' using the following structure: struct thread_data { int size; ...

How to stop ANSI colour codes messing up printf alignment?

I discovered this while using ruby printf, but it also applies to C's printf. If you include ANSI colour escape codes in an output string, it messes up the alignment. Ruby: ruby-1.9.2-head > printf "%20s\n%20s\n", "\033[32mGreen\033[0m", "Green" Green # 6 spaces to the left of this one Green # correctly ...

MySQL dump .sql script and import to an apache derby

So presumably mysqldump can export to ansi compatible format so that you can import to other vendors' databases. However trying to import to an apache derby I face all this syntax errors. Thought I try some regex and fix things but it seems that there are more than a couple. Is there something I'm missing about mysqldump? Tried ddlutil...

How can I determine to which C standard is this code compliant?

In a C lab this uber simple code appears: #include <stdio.h> int suma (int a, int b) { return a+b; } int mult (int a, int b) { return a*b; } int main(void) { int a,b; printf ("Operando 1: "); scanf("%d",&a); printf("Operando 2: "); scanf("%d",&b); printf("%d+%d=%d\n",a,b...

ANSI C equivalent of try/catch?

I have some C code I'm working with, and I'm finding errors when the code is running but have little info about how to do a proper try/catch (as in C# or C++). For instance in C++ I'd just do: try{ //some stuff } catch(...) { //handle error } but in ANSI C I'm a bit lost. I tried some online searches but I don't see enough info abou...

Converting problem ANSI to UTF8 C#

I have a problem with converting a text file from ANSI to UTF8 in c#. I try to display the results in a browser. So I have a this text file with many accent character in it. Its encoded in ANSI, so I have to convert it to utf8 because in the browser instead of the accentchars appearing "?". No matter how I tried to convert to UTF8 it wa...

Object oriented programming in C

Possible Duplicate: Can you write object oriented code in C? Hi, can someone point me to a tutorial explain me how OOP concepts can be implemented in ANSI C: virtual functions inheritance best practice A book about OOP programming ANSI C would be great too. ...

ANSI C vs other C standards

On several compilers I have used (all gcc but various versions) I get a C99 mode error for things like declaring int i inside the for loop expression instead of before it (if I do not use the std=c99 option). After reading here I understand that the gcc options -ansi, -std=c89, and -std=iso9899:1990 all evaluate to the ANSI C standard, ...

Return Zero From Main

I know it's been the convention in ANSI C to always return a 0 integer value from main in a C program, like this: int main() { /* do something useful here */ return 0; } This is to return a "successful" result to the operating system. I still consider myself a novice (or an intermediate programmer at best) in C, but to date...

Initialize an array using openmpi once

I am trying to run some tests using OPENmpi processing data in an array by spliting up the work across nodes (the second part is with matricies). I am running into some problems now because the data array is being initialized every time and I don't know how to prevent this from happening. How, using ANSI C can I create a variable leng...

How do I fix invalid HTML characters in pages served with different encoding?

I have a number of websites that are rendering invalid characters. The pages' meta tags specify UTF-8 encoding. However, a number of pages contain characters that can't be interpreted by UTF-8, probably because the files were saved with another encoding (such as ANSI). The one in particular I'm concerned about right now is a fancy apostr...

Kind of sparse initialization for structures, any resources?

Hi, I used to initialize my structures in this way: struct A a = {0}; This seems to work for me, however I was argued about ANSI C, C89, C99 standard. Simply I couldn't find that in any documentation. Could you help me with that? Here's an example that this works for 'cl' (VS express 2008). #include <stdio.h> struct DATA { i...

Problem trying to use the C qsort function

#include <stdio.h> #include <stdlib.h> float values[] = { 4, 1, 10, 9, 2, 5, -1, -9, -2,10000,-0.05,-3,-1.1 }; int compare (const void * a, const void * b) { return ( (int) (*(float*)a - *(float*)b) ); } int main () { int i; qsort (values, 13, sizeof(float), compare); for (i = 0; i < 13; i++) { printf ("...

Convert NCPDP script from XML to EDI

Is there a tool out there that can convert a Surescripts XML NewRx message to the NCPDP script 8.1 EDI format? I did my messaging for Surescripts in XML, and now read the NIST test at http://xw2k.nist.gov/healthcare/docs/170.304.b_ExchangePrescriptionInformation_v1.0.pdf as requiring the EDI format instead! ...

reading data from memory in C from within an Objective C class

I would like to know if it is possible to read and write data from and to memory with ANSI C code instead of from a file. I have C code that is called from within an Objective C class many times and each time, it has to read in the same large binary file, do some processing on it, and then write out a large binary file (which is slightl...

Implementing a FIFO queue in C (not C++ nor C#)

For an embedded application, I am trying to implement a first-in, first-out (FIFO) queue of structs using ANSI C. The most straightforward way to do this seems to be by implementing a linked-list, so that each structure contains a pointer to the next in the queue. Hence I define the struct itself as: typedef enum { LED_on, LED_off, etc ...