19,876 Topics

Member Avatar for
Member Avatar for Kombat

I am trying to be able to read in 1 000 1 1 1 as like 100011. Also when I do printf of the string program crashes. Here is my code [CODE]#include <stdio.h> #include <string.h> #include <ctype.h> #define MAX 32 int main(void){ int i; int c; char a[MAX]; char b[MAX]; …

Member Avatar for Kombat
0
152
Member Avatar for badlucky

so i have my main program which reads in a data file through the command line, and the data file is a list of names, each line consists of "last name first name" (no quotes obviously) all i want to do is print out the list of names as "first …

Member Avatar for badlucky
0
74
Member Avatar for PMACLEAN

Could someone please advise me on how to implement fork() in a parallel processing (multiplying) of a 2d array....I have been at this for far too long.. here is my code [code] for (int i = 0; i < rowCol[0]; i++ ) result[i] = (float*)malloc ( rowCol[1] * sizeof(float) ); …

Member Avatar for abhimanipal
0
182
Member Avatar for ppotter3

Hello, I am working on a program that takes an integer array filled from a random number generator. These values are suppose to be from -5000 to 5000, 2500 of them. Then I want to find the standard deviation of the numbers in the array. I am required to use …

Member Avatar for ppotter3
0
1K
Member Avatar for cecilia_g1

Hola, Necesito leer un valor de una variable como hexadecimal, y guardarlo en otra, pongo el codigo y quiza con eso quede mas claro. Tengo esto: buffer es un arreglo de caracteres y aux tambien buffer[i] = atoi(aux); Un ejemplo: atoi(aux) me regresa 40 entonces yo quiero que el valor …

Member Avatar for Narue
0
138
Member Avatar for cecilia_g1

Hi all, How can I do assign a Hex value to variable from other variable. I mean I have this: buffer is a char array aux is a chara array buffer[i] = atoi(aux); atoi(aux) return for example 40, then I want to see the value 40 on the buffer[i], but …

Member Avatar for WaltP
0
102
Member Avatar for cecilia_g1

How can I do assign a Hex value to variable from other variable. I mean I have this: buffer is a char array aux is a chara array buffer[i] = atoi(aux); atoi(aux) return for example 40, then I want to see the value 40 on the buffer[i], but is not …

Member Avatar for WaltP
0
76
Member Avatar for icu222much

I am trying to program with semaphores and was told that I should use sem.h. When I compile, I get the error: "sys/sem.h: No such file or directory". How can I fix my problem? [CODE]#include <stdio.h> #include <sys/sem.h> int main() { printf("I am alive \n"); getchar(); return 0; }[/CODE]

Member Avatar for icu222much
0
1K
Member Avatar for rajdesire

How can we use volatile variable in C or C++? Anybody can some good code to understand this.

Member Avatar for gerard4143
0
144
Member Avatar for shrublet

Hello there, I am a Java programmer by trade and am VERY new to C so please excuse any blatant pointer ignorance, if possible. I am having a problem with the concept of returning something but also freeing it afterwards within a method. I am implementing a stack program and …

Member Avatar for rajdesire
0
114
Member Avatar for asm2hex

Hello, I'm having quite a hard time getting around this access violation error I keep getting. Every time I declare a character string in a structure I can never access it. Here's a small example of my code that keeps giving me a error no matter what I try. [CODE] …

Member Avatar for JuhaW
0
118
Member Avatar for sandorlev

Hello! I've started programming C++ a week ago, so I cannot solve my problems easily. I've started a small project for learning classes, it's about encryption and stuff. I don't really get pointers, although I've read some about them. My problem is that when I use the cipher, it replaces …

Member Avatar for vmanes
0
777
Member Avatar for wen30

Hi , i got an application API interface written in C++. i wanted to inherit the interface in C#. can somebody be kind to teach me how may i write this code in C#? [CODE]HRESULT _stdcall ExampleFunction() [/CODE] thanks!

Member Avatar for kvprajapati
0
72
Member Avatar for Kru

Hello I have two c files I am working on. One is a stand alone program (I will call it helper) that will take two ints as a command line argument, add them together, prints the operands and the sum, and exits. This program can be run from the command …

Member Avatar for Kru
0
143
Member Avatar for ankur_

I have taken the opensoruce from ~wagnerr/ConfigFile.html for reading configuration file. It perfectly works fine with gcc 3.2.3 and it fail to compile with gcc 3.4.3 on RHEL 4 I am getting following error g++ -Wno-trigraphs -Wno-unused -Wno-deprecated -Wpointer-arith -fno-common -fno-strict-aliasing -fexceptions -DC_GCC_C -DC_GCCBJC -DC_GCC_CPP -fPIC -D_GNU_SURCE -DC_GNUSTEP -DC_LITTLE_ENDIAN -DDEBUG …

Member Avatar for gerard4143
0
365
Member Avatar for kymarscheng

How to store the data of a program without using registry? Because I don't want the users change the registry and the program settings... Are there any other ways that can prevent the users from changing the settings?

Member Avatar for kymarscheng
0
166
Member Avatar for mo94015

need to change this from availcredit01.cpp to availseats01.cpp and make the necessary adjustments 1)ask user to enter the room size 2)get room size 3)ask user to enter number of students 4)get enrolled 5)set avilseats to room size minus enrolled 6)display the available sets 7)halt and return to operating system i'm …

Member Avatar for Narue
0
97
Member Avatar for FreakNFlow

I am in need of some help. I need a program that will play the game Three's Free. You roll six dice. 3's are equal to 0. Every turn you take away one of the dice, so every time you roll you take away one die. If you don't roll …

Member Avatar for WaltP
0
90
Member Avatar for solitude_spark

dis is a simple c program.. but while using it in borland c++ 4.5 ,, declaration syntax error is being displayed at file1.h ..why so? file1.h [CODE] #define USD 1[/CODE] file2.h [CODE] #define UKP 1 [/CODE] file3 [CODE] #include<stdio.h> #include <file1.h> #ifdef USD #define curr 46 #endif #ifdef UKP #define …

Member Avatar for Nick Evan
0
86
Member Avatar for robbtek

Hello , I need to pass a system (linux) result to a varaiable . Example : ... char KERNEL = system("uname"); printf(KERNEL); ... this example dont work , can you help me ?

Member Avatar for Salem
0
373
Member Avatar for kylcrow

I am getting this compiler error: gcc -g -Wall -O2 -c -o mybash.o mybash.c mybash.c: In function ‘main’: mybash.c:39: warning: implicit declaration of function ‘getline’ mybash.c:41: error: expected expression before ‘)’ token make: *** [mybash.o] Error 1 It probably has to do with something I don't remember about initializing and …

Member Avatar for kylcrow
0
157
Member Avatar for cmsc

please help me find the error in this code. whenever i try to get the successor, the program gets the status access violation error. i think it's the parameter. i try using the minimum function outside the delete and it works. but when i try it inside the delete i …

Member Avatar for cmsc
0
197
Member Avatar for Diode

I know they don't have standard ASCII values, but how do you check for them? I am making a command prompt-type interface for a text-based RPG a friend and I are making, and I would like to be able to use the arrow keys to navigate in menus. I am …

Member Avatar for hsp700
1
4K
Member Avatar for WargRider

Hello Everyone, As you can see, I am new to DaniWeb, and might I say this is a VERY good community. Either ways, my problem is a pretty complicated one, which I have been working on for a while now, 2-3 weeks. I am assigned by my team to create …

Member Avatar for Nick Evan
0
399
Member Avatar for jamesonh20

Is there a way to reference winmm.dll's to get ID3 info. Everything I have looked at online shows programming of your own mp3 data (i.e. Title, artist....). There has to be a way to just retrieve the file info from the DLL right??? JamesonH20'

Member Avatar for kvprajapati
0
67
Member Avatar for batman3

[b]Split from - [url]http://www.daniweb.com/forums/thread8443.html[/url][/b] How do you post each integer in a seperate line once it has been reversed?

Member Avatar for WaltP
-2
38
Member Avatar for Covinus

greetings again. few more question.. [code] /*----------------------------------------- MENUDEMO.C -- Menu Demonstration (c) Charles Petzold, 1998 -----------------------------------------*/ #include <windows.h> #include "resource.h" #define ID_TIMER 1 LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; TCHAR szAppName[] = TEXT ("MenuDemo") ; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { HWND …

Member Avatar for downtimedk
0
515
Member Avatar for Whilliam

Hello. Im new to Trie. I know it's concept but I can't declare and access it correctly. I tried making a code. It's like this. [code=c] #define max 27 typedef struct ctype { struct ctype (*letter)[max]; int counter }trie void main() { trie t; int ctr; for(ctr = 0; ctr …

Member Avatar for abhimanipal
0
75
Member Avatar for ibuguser

Hi, I have a program that writes to a specific memory location. I can currently read the value doing this: [CODE] #define address1 0x000F0000 //this is the memory location unsigned long *val1 = (void *) address1; [/CODE] So * val1 contains what I need from the other program. Now I …

Member Avatar for gerard4143
0
147
Member Avatar for priyarrb

This is an CPU sheduling algorithm i.e proirity sheduling .It show some error that i can't solve please anyone correct it . its very urgent.[code]#include<stdio.h> #include<conio.h> void main() { int a[20],b[20],c[20],e[20],d[10],totaltime; int att,at,aw,awt,t1,i,j,n; clrscr(); printf("\n\t\t\tpriority scheduling"); printf("\nEnter the no of process: "); scanf("%d",&n); for(i=0;i<n;i++) { printf("\n"); printf("\nprocess: "); printf("%d",i+1); c[i]=i+1; …

Member Avatar for abhimanipal
-1
144
Member Avatar for mattitude

Basically, I'm writing some code that will take text from some .txt files and rearrange them into other .txt files. I've written 3 functions, but ignore the 2nd one, I haven't worked on it yet. When I try to call my 3rd function, I get an error message from Dev …

Member Avatar for mattitude
0
377
Member Avatar for swathydoss

hi....... i want a program in c based on any data structures with de code.plz............it shd be catchy n can be based on reality

Member Avatar for jephthah
-4
90
Member Avatar for ubi_ct83

hi all, thanks for reading my post. sorry about the tittle (so whatever ;)) i have this situation. i have an array like this: lemon banana pineapple and i have fruit.txt which has this inside: corn melon berry blackcurrent apple what i want to do is, i want to copy …

Member Avatar for WaltP
0
72
Member Avatar for mhera

Make a C program that will ask the user to input a secret message. Your program will then encrypt and display the cipher text using the encryption formula. Also, to recover the original message, your program should be able to decrypt and display the shift cipher text. Sample Program Interaction: …

Member Avatar for Salem
-2
96
Member Avatar for SecurExpert

Hi guys, Would someone please let me know the difference between these two: [CODE] struct node* branch; // this statement struct node *branch; // && this statement [/CODE] Thanks.

Member Avatar for Ancient Dragon
0
66
Member Avatar for pao+kriz
Member Avatar for gerard4143
0
57
Member Avatar for miles.85

Hi! I'm working on a compress algorithm. But I couldn't write the software because I don't know how to read and write a file as binary like 101011111111011001. How can I read the like this ? Also I want to ask if I can write the GUI on Java and …

Member Avatar for miles.85
0
143
Member Avatar for mfrancis107

I'm working with Kochan's Programming in C. I am working in Visual Studio 2008. When I try to build the program I get Error 2 error C2143: syntax error : missing ';' before 'type' c:\users\michael\documents\visual studio 2008\projects\cpractice\cpractice\char.c 15 CPractice But as far as I'm aware there is no syntax error. …

Member Avatar for WaltP
0
157
Member Avatar for vicsta

Pls help me to write a c++ program that reads or accept an integer and output its equivalent into base two 2. Write a c++ program which reads an integer and decides whether the integer is a multiple of 5 pls you can help me to send it to my …

Member Avatar for Narue
-1
105
Member Avatar for abhimanipal

Hello Everybody, I have just come across this particular piece of code in a C problem set [code= c] main() { int i=5,j=6,z; printf("%d",i+++j); } [/code] The answer for this question is 11 because C evaluates this as i++ +j. But why cant this be evaluated as i+ ++j. Is …

Member Avatar for SpyrosMet
0
265
Member Avatar for jdpjtp910

I have a program for school that I need help condensing some code, if possible. I have structure that has 10 fields for a monthly budget. I will have the user input their current budget and then my program informs the user if they are over under their budget and …

Member Avatar for jdpjtp910
0
515
Member Avatar for gianx80

Hi! I'm writing a little equation solver for an exam ... it has not to be perfect or mathematically rigorous. With this program I have only to show to my professor that I can write some simple program in Assembly and C++ language. In other words, I have only to …

Member Avatar for Salem
0
247
Member Avatar for ppotter3

Hello! I have a question, I have been struggling with this for a bit (I welcome any constructive criticism and pointers) now, and I am pretty new to C++. I am in the process of writing a program that takes names in the format of LAST, FIRST; the it loads …

Member Avatar for ppotter3
0
1K
Member Avatar for thirupathireddy

Hi All, I am getting segmentation fault when I am allocating memory for the node second time. [code] struct host_msgs_list { [B]struct host_msgs_struct *message;[/B] struct host_msgs_list *next; }; struct host_msgs_list *root, *temp, *temp1; root = NULL; temp=root; For the first message (i.e. OHAD), it’s able to allocate the memory. We …

Member Avatar for abhimanipal
0
113
Member Avatar for james chaco

[b]Split from - [url]http://www.daniweb.com/forums/thread231732.html[/url] [/b] Hi guys i want to make a project in which i am planning to create a full functional shell. But i don't know how and where to start from. Please anybody reply if you have any knowledge regarding this. Any website ,any starter information will …

Member Avatar for abhimanipal
0
109
Member Avatar for jennystc

I need help creating a grade calculator in C. I am not allowed to use conditional statements. My problem is that I have written code to determine how many total points the student has, but I cannot think of a way to classify those points as an A (90-100), B …

Member Avatar for abhimanipal
0
190
Member Avatar for ppotter3

Hello! My name is Page, and I am having problems figuring out how to read a name for example like; SMITH, JOHN in a string array. From there I would like to find the space and read the last name into a vector and the first name into another vector. …

Member Avatar for ppotter3
1
7K
Member Avatar for baulinp

umm... hi guys.. this is baulin.Am completely new towards system calls.plz give me some info about the job which exit() system call does..

Member Avatar for adnan.siddique
0
103
Member Avatar for karthiken07

How to create Run as Administrator option of windows OS in c code.. It is required for my software. plz help me.

Member Avatar for ChaseVoid
-1
165
Member Avatar for borkoBorule

Hi everyone, I'm n00wbie to C# and I I have one question. I'm writting class for access to MySQL over DbLinq and I need to know connection string. I know that I can read connection string from webconfig file. My question is is there any function in C# that I …

Member Avatar for apegram
0
80

The End.