15,540 Topics
| |
Hello, I am trying to store data within a char in C. Different types of data will be used, for example, strings and integers. I have tried the following code: [code]char rawdata[4] = {0xfe, 0x01, 0x99, 0x42}; unsigned int *test = (unsigned int*) rawdata; printf("%u\r\n", *test);[/code] However, it returns the … | |
//================= konfigure LCD // porta za podatoci e PORTB sbit LCD_RS at RB4_bit; sbit LCD_EN at RB5_bit; sbit LCD_D4 at RB0_bit; sbit LCD_D5 at RB1_bit; sbit LCD_D6 at RB2_bit; sbit LCD_D7 at RB3_bit; sbit LCD_RS_Direction at TRISB4_bit; sbit LCD_EN_Direction at TRISB5_bit; sbit LCD_D4_Direction at TRISB0_bit; sbit LCD_D5_Direction at TRISB1_bit; sbit … | |
hejsa, I just got a little problem.. [B]i only have one public ip.. but i need to host several websites over many local ip's..[/B] so, i need to forward the incomming requsts (from the public) to one of the local ip's.. based on the domainname.. so, [B]mydomain.com > my public … | |
The code below will printf out the no. of characters as 6, even if we enter only 2... [CODE] #include<stdio.h> #include<string.h> int main() { FILE *fp; char c; fp=fopen("random","w"); while((c=getchar())!=EOF) putc(c,fp); printf("\nNo. of characters = %ld",ftell(fp)); fclose(fp); } [/CODE] | |
I have to write for the program. If someone could help me to understand the problem?? The example of the MAC message would be very useful for me program the PIC to work as a Super Router, and reading the serial port frame, forwards them to the standard, or rejected. … | |
I have to do my homework for passing the course :) The question is that; Firstly the starting point is (x1,y1) we get these values from user and we get a lot of two dimensional points from user.If a point is far away from the center point of the points, … | |
Ive made my binary tree in the following format [code=C] typedef struct node { int info; struct node *left; struct node *right; }*nodeptr; [/code] Im looking for a function that will accept the root pointer and print the tree in a graphical format. for eg. i want the output to … | |
what's wrong with this program, i will sort descending this program [CODE] #include <stdio.h> #include <stdlib.h> FILE *fp; typedef struct buku{ int no; char judul[30]; char pengarang[30]; int jumlah; }dt_buku; dt_buku sementara[50],bantu; int i,j; void tukar(void); void viewData(void); void sortData(void); int main() { viewData(); printf("\n\n"); sortData(); return 0; } void … | |
Hello Everyone! I am due with an assignment that I just can't seem to acomplish. So here's the deal: I get a file with the following structure: TyP_1 TyP_C2 TyP_C3 ORDER Nr_rec rec1_field1 rec1_field2 rec1_field3 rec2_field1 rec2_field2 rec2_field3 Typ_x can be S for string N for numeric or C for … | |
[CODE] #include<stdio.h> main() { int array[100], n, c, d, swap; printf("Enter number of elements\n"); scanf("%d", &n); printf("Enter %d integers\n", n); for ( c = 0 ; c < n ; c++ ) scanf("%d", &array[c]); for ( c = 0 ; c < ( n - 1 ) ; c++ ) … | |
Aim: I am learning pointer of C,now I want to write a function to change the value of a variable . [CODE]#include<iostream> using namespace std; void change (int * k) { if (*k==1) *k==0; else *k==0; } void main() { int a=1; cout<<a<<endl; change(&a); cout<<a; }[/CODE] I thought that n … | |
how to sorting this, i've problem to sort by *jum_nilai* from the highest until smallest void lihatData(void) { if(pertama==NULL) printf("Data tidak ada !!!"); else { printf("%3s %-20s %-12s %-5s %-7s %-7s %-5s %-5s\n","No","Nama","Jenis K","N Mtk","N B.Ind","N B.Ing","N IPA","Jumlah"); printf("--- -------------------- -------------- ------- ------- ------- ----- -----\n"); sekarang=pertama; do { printf("%3d … | |
Jan Feb Mac Apr Mei Jun 2006 2.53 2.24 1.91 1.72 1.45 1.38 2007 2.72 2.56 2.32 2.01 1.98 1.84 In my assignment, a similar table regarding rain is given like above. But, the real table contain 4 years and 12 months.The extra info given is: float rain[5][12] Create a … | |
Hello, I'm doing a project for my Compilers course and I stuck up on this. my project is little, it's a program that allows entering a mathematical equation and identifies and outputs the equations type to the user. I wrote the grammars for it and used Flex to generate a … | |
hi can someone help??? I have done my assignment but my teacher asked me to do a test plan and test log I don't know how to do it....... please help me, I need some idea how to start..... | |
I'm trying to make a binary calculator and I just can't find what's going wrong: [CODE]#include <stdio.h> void dec2bin(long decimal, char *binary); void dec2bin1(long decimal2, char *binary2); int binaryAddition(int,int); int main(void){ long int binarym1,binarym2,multiply=0; int digit,factor=1; long decimal; long decimal2; char binary[80]; char binary2[80]; printf("\n\n Please enter the first value … | |
hi all, i am trying to run a command from shell and it is running fine but if i am trying to run the same command using system function then its not working. about the command: this command is used to transfer file from one machine to another. please find … | |
hi, i want some problem so that i can write its code.my vacations are there and i m thinking to practice some codes.i have done data structures well and please gives problems on which i can think and implement them. :-)) don't give too much high level problems. | |
Hello Everyone! That's my first post on this forum and I'd like to greet Everyone I got a question about getting the last key pressed without stopping the programm. I know that getchar(), cin, getch() commands don't allow to do that. Have You any idea how to solve this problem? … | |
Actually i got the source code form official website but its looking like latin & greek !!!! So in order to understand the source code !! from where should i start ???? how can understand where to begin with and go on to end..... provided i have the knowledge of … | |
This is for an extra credit assignment for class. Requirements I am having trouble with: 1. User enters number specifying numbers of integers 2. User enters integers 3. program will read them and parse. ---------------------------------------------------------- Here is a sample input and what the program should do: How many numbers: 5 … | |
Dear all, I have a quick question about if-else-if control flow (you'd think by now these questions would be unnecessary, but here I am): If I was told to rewrite a function that looked like this (this is an exam question so I am not asking the exact question in … | |
Hi once again. As the title implies, the goal of the following code is to create calculator for operations +,-,*,/ and ^. However, the operations are to be executed on values in the files I arbitrarily named a.txt and b.txt. a.txt contains following data: a1 era1 a2 era2 . . … | |
I need know what is the size of a address of one variable, in other words, how much bytes I need to store the address of a variable (in compilation time). Unhappily not is possible use sizeof in define pre-processors, like this: [CODE] #define ADDRESS_SIZE sizeof(void *) [/CODE] So, I … | |
Need some help computing the geometric mean of an array this is what I have so far... i'm not really sure why i'm suppose to use pow [CODE]include math.h include int geomean(int *myarray, int count) { double geo = 0; double count = (double)count; for(int k=0; k < count; k++) … | |
Hello, I wrote two programs which sort first names which are already sorted by their last names.One is with Selection sort and the other is with Quicksort! The question is , "is any one of them stable?." "If the names with same first names are still in sorted order by … | |
The purpose of this code is to open a file, read a passage and delete any word that is "secret", it is then to save the new passage to a new file. Problem: [Warning] passing arg 1 of `strcmp' makes pointer from integer without a cast I think I know … | |
[COLOR="green"]10 Coins Puzzle[/COLOR] Hello Friends, I m facing problems in coding of 10 coins Puzzle. I have made it, but the process was not good enough. I think there is a recursive process to sole this problem, but i couldn't get it. Plz help me out with efficient algorithm/code. | |
hello everyone I write project, there is problem in linking of my code [CODE] Error 1 error LNK2005: _str_list already defined in file1.obj string-test\file2.obj string-test Error 2 error LNK2005: _str_list already defined in file1.obj string-test\str.obj string-test [/CODE] think this is my code, anybody have any idea [B]main.c[/B] [CODE] int main() … | |
[CODE]#include<stdio.h> #include<conio.h> struct egde { int nodeno; struct edge*next; }; struct node { int nodeno; struct node *next; struct edge *link; }; struct node*graph=NULL; typedef struct node node; typedef struct egde edge; node*find(int); void insert_egde(); void insert_node(); void display(); int main() { int ch,i,j; do{ printf("\ninsert node"); printf("\ninsert edge"); printf("\ndisplay"); … |
The End.