19,876 Topics

Member Avatar for
Member Avatar for johnnyboy567890

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 …

Member Avatar for Ancient Dragon
0
98
Member Avatar for EvaL2ne

In file i have a text. Words form line to line dont raising. Word in line separate least one space.Spaces can be at line begining and ending, can be empty lines. Count how many words can be in real number. i need a function whitch can count words whitch can …

Member Avatar for WaltP
0
318
Member Avatar for kikic

//================= 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 …

0
104
Member Avatar for brugernavn

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 …

Member Avatar for brugernavn
0
172
Member Avatar for Rupindersingh

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]

Member Avatar for Ancient Dragon
0
117
Member Avatar for kikic

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. …

0
97
Member Avatar for whitech

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, …

Member Avatar for whitech
0
331
Member Avatar for basukinjal

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 …

Member Avatar for steve.lorimer
1
11K
Member Avatar for rizal189

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 …

Member Avatar for v3ga
0
91
Member Avatar for Kathyrine

I am trying to sort a record according to their respective number like this: [CODE] 5 reyes d r 1 2 3 3 delos d k 4 5 6 9 go t r 7 4 5 1 po w w 2 2 2 2 bun b m 3 3 3 …

Member Avatar for Kathyrine
0
5K
Member Avatar for lynxul

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 …

Member Avatar for humnah
0
169
Member Avatar for rithish

[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++ ) …

Member Avatar for Despairy
0
144
Member Avatar for tiredoy

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 …

Member Avatar for WaltP
0
129
Member Avatar for ashar5

Hi, I am running embedded mongoose webserver in server side (Linux centos). In the client (Windows) I am using c++ with libcurl to post request to webserver. It works successfully all the time. But now, I am facing ssl connectivity issue in client side. Without ssl, it works fine. If …

Member Avatar for jmichae3
0
244
Member Avatar for rizal189

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 …

Member Avatar for zeroliken
0
70
Member Avatar for DACP

What should I do to change this code using else-if so that it will read the first character in my input text file and then determine which equation to use? For example, the first line in the input text file is A 4 8 and the second line is M …

Member Avatar for mrnutty
-1
2K
Member Avatar for hanisakura92

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 …

Member Avatar for zeroliken
0
178
Member Avatar for samerhaffar

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 …

Member Avatar for L7Sqr
0
207
Member Avatar for Hsalih

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.....

Member Avatar for gusano79
0
56
Member Avatar for EdwardVX

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 …

Member Avatar for shibblez
0
119
Member Avatar for cgray1989

I'm trying to figure out how to do this program. A program is required to print and read a series of exam scores for students enrolled in a math class. The class average is to be computed and printed at the end of the report. Score can range form 0 …

Member Avatar for jmichae3
0
138
Member Avatar for sodalee702

[B]I have a question, pls help, thanks very much.[/B] Try to write a C program which can analyze the input of the user in the following aspect. 1. vowels 2. consonants 3 digits 4 white spaces 5 others You must use the logic of pointer to do this analysis in …

Member Avatar for v3ga
0
204
Member Avatar for priyankpatel

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 …

0
47
Member Avatar for gourav1

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.

Member Avatar for v3ga
0
90
Member Avatar for cgray1989

I'm trying to figure out how to do this program. A program is required to print and read a series of exam scores for students enrolled in a math class. The class average is to be computed and printed at the end of the report. Score can range form 0 …

Member Avatar for jackmaverick1
0
131
Member Avatar for surakesh

[CODE]using Excel = Microsoft.Office.Interop.Excel; namespace program { private void cmdOpen_Click(object sender, System.EventArgs e) { FileSystem.FileOpen(1, inputfile, OpenMode.Input, (OpenAccess)(-1), (OpenShare)(-1), -1); // 1 : excel file Excel.Application MyXl; MyXl = new Excel.ApplicationClass(); MyXl.Visible = true; Excel.Workbook xlWorkbook = MyXl.Workbooks.Open(inputfile, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, …

Member Avatar for thines01
0
282
Member Avatar for WARburg

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? …

Member Avatar for zeroliken
0
3K
Member Avatar for venkat4krish

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 …

Member Avatar for zeroliken
0
235
Member Avatar for asuprem

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 …

Member Avatar for asuprem
0
625
Member Avatar for MylesDBaker

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 …

Member Avatar for MylesDBaker
0
142
Member Avatar for The 42nd

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 . . …

Member Avatar for zeroliken
0
133
Member Avatar for ricardo.crudo

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 …

Member Avatar for ricardo.crudo
0
86
Member Avatar for stamatt45

[I]To make it easier to read, only the relevant code is below, and due to circumstances beyond my control im stuck using Xcode for the next week or so (hate this debugger).[/I] I need help fixing a seg_fault in my current program. It occurs the last time "buildPaths" is called. …

Member Avatar for stamatt45
0
226
Member Avatar for theUserMan

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++) …

Member Avatar for zeroliken
0
494
Member Avatar for AlvinLiu

what is code mean? [CODE] void fo(){ count += 1 + !(count <5); cout << count <<endl; } [/CODE] Thank you .

Member Avatar for MandrewP
0
188
Member Avatar for challarao

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 …

Member Avatar for WaltP
0
324
Member Avatar for DiabloInC

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 …

Member Avatar for zeroliken
0
264
Member Avatar for manjeet593

[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.

Member Avatar for Adak
0
135
Member Avatar for BlZbB

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() …

Member Avatar for WaltP
0
258
Member Avatar for gourav1

[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"); …

Member Avatar for mikrosfoititis
0
254
Member Avatar for sum337

Hey ive tried to learn C++ by myself at home and decided that the best way to motivate myself was creating ye old dos text game. Im stuck at this so far and was wondering how can i improve my basic layout? also since its a text game how could …

Member Avatar for WaltP
0
3K
Member Avatar for twistercool

Just a Question on C programming basic some instructors have different ways of using either getche() or return 0; as bottom code on main function. Which is more better to use getche() or return 0;?[code]Getche() vs return 0;[/code]

Member Avatar for Moschops
0
277
Member Avatar for ConfusedLearner

Using a text editor (i.e. Notepad), create a text file called Text1.txt and place it into a folder of your choosing. Fill Text1.txt with a sentence and save the file. Then, write a C++ program that performs the following: 1. Reads the sentence from the file Text1.txt and display it …

Member Avatar for bboy_fresh
0
274
Member Avatar for ZedChu

Hi, I have linkend list in my program and I need to swap two elements. [CODE]typedef struct { int day; char month[10]; } LData; typedef struct element LElement; struct element { LData data; LElement *next; } typedef struct { TLement *head; } TLinked; [/CODE] Then some basic functions - initialization, …

Member Avatar for zeroliken
0
92
Member Avatar for farshadak2004

Hi My project is building a dictionary and I have done everything for it. Just I want to add a feature to my dictionary which is able the user to leave the cursor on the word which he/she want to find the meaning. after that the meaning appear in a …

Member Avatar for cool_zephyr
0
446
Member Avatar for MadeleinePV

Hi all, I've got a class which I would like to hold a stream used for logging. The stream should be able to be set (and possibly reset) after the construction of the object. It should be possible to set the stream as std::cout, or as a file stream to …

Member Avatar for mrnutty
0
973
Member Avatar for Jameske

So I have written some code which reads a file line by line, breaking each line into characters and storing into a multidimensional array. However the program freezes and crashes at lines 31-34. When debugging the code runs successfully through the for loop once, then fails at 32 the second …

Member Avatar for Jameske
0
216
Member Avatar for Rass Saee

[CODE]using System; using System.Collections.Generic; using System.Text; class BaseClass { public virtual void method() { Console.WriteLine("BaseClass method"); } } class SubClass : BaseClass { public override void method() { Console.WriteLine("SubClass method"); } public void someMethod() { Console.WriteLine(); } static void Main(string[] args) { BaseClass var = new SubClass(); var.method(); var.someMethod(); } …

Member Avatar for arunkumars
0
104
Member Avatar for sharathg.satya

hi all Can we (compile and execute) or just execute a c file from another c file? am asked this question and i am unable to find any solution to this problem. A 'c' file is executed and it must contain code that will execute another 'c' program olease help …

Member Avatar for Narue
0
266
Member Avatar for manju1438

hi all, i got stuck up in running a C program(project).it says 'binary not found error'. i am able to debug it,under ARM cortexa8 configuration. here what does refer to.....is it .exe file or .axf file. how can we generate those .exe and .axf files. anyone please clearly explain running …

0
78

The End.