Hi
I am using Code Block IDE with Mingw Compiler on Windows XP 32 bit. I am working on small project in which we are reading from text file. We were doing some processing based on ASCII value of those characters. Now requirement has changed, the file may contain letters from other languages also,which is not there in ASCII. So I just need a way to read those characters from file and get their UNICODE so that we can continue processing...
User Profile
Collapse
-
Reading unicode characters from file in C
Hi
I need to read Unicode characters from a file. The only thing I need to do from them is to extract their Unicode number.
For example if file has ΓΌ I need to extract its corresponding Unicode number.
Please help.
Thanks -
Yes I am looking for a method in which I can generate randon numbers without using sleep. (with sleep i can pass different seed) but i am looking for an alternative to sleep so that performance do not deterLeave a comment:
-
Random number generation
Hi
I am generating 256 bit key for AES. I am using the following implementation
Code:void fill_random_key(char *key) { /* Length of the key */ unsigned short int length = KEYLENGTH; /* Seed number for rand() */ srand((unsigned int) time(0) + getpid()); int i=0; while(length--) { key[i]=rand() % 127;
-
Thank You Donbock. I think I need to make my own function that will check the string for integer float or character.Leave a comment:
-
fflush
If stream points to an output stream or an update stream in which the most recent operation was not input, the fflush() function causes any unwritten data for that stream to be written to the file, and the st_ctime and st_mtime fields of the underlying file are marked for update.
If stream is a null pointer, the fflush() function performs this flushing action on all output or update streams in which the most recent...Leave a comment:
-
Implementing generic stack
Hi
Currently I am implementing a generic(int plus float etc) stack in C. However I am facing some problems.
stackgen.h
Code:#define STACKSIZE 100 #define INTEGER 1 #define FLOAT 2 #define STRING 3 struct stackelement { int etype; union { int i; float f; }element; }; struct stack
-
@ rusty uts
The code that I posted works fine for me. I am running in code block mingw compiler. Please checkLeave a comment:
-
I have got the above from Internet. The above is also giving error. Can you elaborate more on this with detailed explanation?Leave a comment:
-
Code:#include<stdio.h> #include<conio.h> #include<string.h> main() { struct boy { char name[100]; int marks; }; struct boy a[100]; int no,i,l,m,k,t; char nam[100]; printf("Enter no of students"); scanf("%d", &no);
Leave a comment:
-
For the second question you are forgetting to add & while inputting
Code:printf("Enter pages"); scanf("%d", &b[i].pages); printf("Enter Book Number"); scanf("%d", &b[i].no);
Leave a comment:
-
Structure offset
Hi
I want to find offset of structure elements
Code:struct { char a; int b; char c; }example;
Code:unsigned int offset; offset = (unsigned int)(&(((example *)(0))->b));
-
Array using stack
Consider a language that does not have arrays but does have
stacks as a data type.and PUSH POP..are all defined .Show
how a one dimensional array can be implemented by using two
stacks.
I am unable to solve this. Can somebody tell me whats the approach one should follow? I dnt need the code, only approch will suffice. -
Replacing break and continue with structured equivalent
Hi
Is there any way by which we can replace break and continue with structured equivalent.
We can cause loop continuation test to fail but break exits immediately from the point it is encountered so the statements after it are not executed.
Eg
int i=1,j;
for(j=0;j<10;j+ +)
{
break;
i++;
}
I can replace this as
... -
Thank You Banfa. I got your point. Thanks a lot. Will keep this in mind.Leave a comment:
-
Problem while reading through socket
Hi
I am developing a chat server program.
I am not able to get client name from this line
read(connfd,inf o[j].name,MAXLINE);
When i remove read(connfd,no, 3);
It is reading name.. Can somebody solve my problem. I need both. Please help
///////////server
Code:#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <string.h>
Last edited by Niheel; Jun 11 '11, 08:19 PM. -
How to connect application to internet?
Hi
I am building a project on C# based on share market but few problems i am facing
How will i connect my application to Internet?
We want to put stocks of BSE so how will i get stock quotes of BSE in my application which is being updated every second?
Please help, thanks in advance. -
got the answer
it should be
#ifndef NODE_H
#define NODE_H
Many Thanks to allLeave a comment:
-
@Redson
It worked earlier with same names
@banfa
I copy pasted the code(of yours) it still gave same error...Now what i did
Code:#ifndef SIZE_GRAPH #define SIZE_NEIGHBOURS 10 #define SIZE_GRAPH 100 #include<iostream> enum STATUS{ready=0,waiting=1,processed=2}; class Node { public: char info; int distance;
Leave a comment:
-
Problem Multiple definition of enum
Hi
I was implementing BFS and DFS
So I have three class stack,queue,nod e and main class
I have put Node class in Node.h
Code:#define SIZE_NEIGHBOURS 10 #define SIZE_GRAPH 100 #include<iostream> enum STATUS{ready=0,waiting=1,processed=2}; class Node { public: char info; int distance; STATUS node_status;
No activity results to display
Show More
Leave a comment: