18,491 Topics
Hey so heres a simple program I'm making that has to calculate a number from different inputs by the user. It worked for a bit, but now when executed the command prompt screen comes up but its blank, then I try to close it and it stops responding. Then when …
I've just installed gcc and then compiled my c program, but it does not seem to work... OS: opensuse11.1 Note: there's no error in the program since i compiled it in fedora but in opensuse there seems to be a problem in installing library!! [B]Need help! Very urgent!![/B]
hi everyone..... how to create a c compiler using c language.... can anyone explain the steps involved..... thnx in advance
how to use push and pop here??? thanks! #include<stdio.h> #include<stdlib.h> void push(char palindrome[20], int *top, int value) { if(*top<=10) { palindrome[*top]=value; *top++; } else { printf("Stack is full!!"); exit(0); } } int value; void pop(char palindrome[10], int *top) { if(*top>=0) { value=palindrome[*top]; *top=*top-1; } else { printf("The stack is empty!!\n"); …
Hey everyone, So, for a class I am taking, I am building a Lego robot whose main function is to drive around a room and collect data (via a sonar sensor) as to where objects are in its surroundings. Some of the data I will collect is: Current robot position, …
I have a problem of interfacing 2 systems of different manufacturers.While one system sends data in 32-bit floating format,the other system understands data only in integer format(16 bit ,32 bit etc).my problem is to convert the 32 bit float data to integer format that can be recognized by 2nd system(its …
Hello friends! I m dips,intrested to know about C,CPP,VB,SQL specially. so please help if needed.
i want to print string(given as input) as number(o/p) and i did it in c using switch case .i want to do the same in python... wat if python provides switch case??n do we have equivalent of it in python?? Examle: input:three hundred and fifty(string) output:350(number)
Hi! I need to find out the size of an arbitrary file and then binarize it in C. I can do this with txt files, but how could I generalize it? This is how I get the size: [code] const char* filename = argv[2]; ifstream messageFile(filename); beginFile = messageFile.tellg(); messageFile.seekg …
could anyone help me with the code to extract a matrix from a file? i would also need to be able to know the dimensions of the matrix i am extracting. thanks in advance
I have written the below code in C ,the problem I have one proccessor and I am not sure if it will work, [code=c] /*#include <stdio.h> #include <stdlib.h> required for randomize() and random() #include <conio.h>*/ #include <stdlib.h> #include <stdio.h> #include "mpi.h" #include <math.h> //int N = 8; /*typedef struct { …
im not sure if this is the right place to post this doubt.. i have installed this cint interpreter 5.15 think is i dont want those many options and i want to reduce it to the bare minimum...but the thing is im not very strong in c/c++ and this whole …
What is enumeration? What is the difference between call by value and call by Referance? With examples?
Hi all, consider the below code snippet: struct ips { int i; }; struct ips * ipsptr; int * ptr; ipsptr = (struct ips * ) malloc(sizeof(struct ips)); ptr = ipsptr; free(ptr); what is the effect of the code above? Does it cause memory leak? Please suggest how it happens …
[B]i research a code, and it goes like this:[/B] [code=c]include<stdio.h> #include<conio.h> void main() { int a[12],b[12],c[12],i,j=0,k=0; clrscr(); printf("Enter 12 numbers\n"); for(i=0;i<12;i++) { scanf("%d",&a[i]); } for(i=0;i<12;i++) { if((a[i]%2)==0) { b[j]=a[i]; j++; } else { c[k]=a[i]; k++; } } printf("The even numbers are\n"); for(i=0;i<j;i++) { printf("%d\n",b[i]); } printf("The odd numbers are\n"); for(i=0;i<k;i++) …
I have written the following code for reading and outputting characters and strings and then converting the strings to lowercase and sorting the characters with bubble sort! When I run the code, the code loops infinitely without doing anything except reading and outputting the strings and characters. Can someone help …
Now i'm not asking for a complete easy answer or source, so please take the time to help me. I would like a very detailed explanation telling what to do, I have no idea. I am very confused by stacks, functions, pushing, popping, and all that. I am very new …
Hello guys, I'm new to this forum so let me know if there's something wrong with my message. I've recently bought a new computer: [Windows XP SP3 x32, Intel(R) Core(TM)2 Duo CPU, E7400 @ 2.80GHz, 1.60GHz, 2.50GB of RAM, Physical Address Extension]. After installing Turbo C 3.0, I tried to …
I'm studying sequential set representation, and one of the only lines in the code that i cant figure out is this [code=C] #define MAX(a,b) (((a) > (b)) ? (a) : (b)) [/code] i get that MAX if a function with two operators, a and b but i dont really understand …
Hi, i want to read some lines to an output text file in a loop. My problem is, that i want to start clearing the text file and then append to it in a loop. At the moment i use: ofstream file; file.clear(); file.open("book.txt", ios::app); for (map<string,Person>::const_iterator it = adrbook.begin(); …
[B]cannot convert parameter 1 from 'char' to 'char *'[/B] calcCharges(type_of_gas, &rate_of_gas, number_of_gallons, &total_gas_of_price, car_wash, &price_of_car_wash, &total_cost);
I'm still generally new to C, I understand most basic concepts, and were now starting to learn much more complex tasks. Right now im stuck on a program to add polynomials, using linked lists. My book Data Structures - An Advanced Approach Using C, is a real difficult read, and …
hey how to make an object move in an C graphics program, eg; i have drawn a swing and i want it to move... i am beginner in C graphics program so please help me...:(
Hi guys, i'm working on trying to pass commands from the console from one program to another program by using pipes() and the execve() system calls. I'm pretty much stuck right now, because I can't seem to determine what i'm doing wrong. Here are my code listings [code] #include <errno.h> …
uhm, i really need help on recursion problems, and the first problem before my assignment is me because i really dont know how to do it, or how to construct it successfully... this is my assignment: a program that will read 10 integers,display them as inputted and in reverse order, …
print the decimal, octal and hexadecimal values of all character between the start and stop character entered by user, For example, if the user enters and 'a' and 'z', the program should print all the character between 'a' and 'z' and their respective numerical values. make sure that the second …
hello...i am new here and also new in IT enviroment, try to do my assignment as below Write C program that accept a character using scanf () function,if the character is lowercase letter,convert to uppercase letter and display the letter in its uppercase form, if the character is uppercase, convert …
im writing a calculator programme for my project. But i dont know how to find Tan, Cos, Sin. Any one can help I would appreciate that. what is the formula
Hi I am new to c programming language, I have written this small code and I dont know why cant i use the free() here, any clarification highly appreciated. [code=c] int insert(element **head, int d) { element *temp; temp = (element*)malloc(sizeof(element)); if(temp == NULL) { printf("\nError: Failure to allocate memory\n"); …
Hi Everyone on DaniWeb I am a babyboomer and enjoyed many roles in IT. Programmed in Fortran, Cobol, SAS, C. Then [B].com[/B] arrived and picked up HTML - and had to get online (and quit workin' for "the man"). I love working from home and finding everything online I need …
hie im Rupali im doing my final yr project using IVR for car dial. I have no idea from where to start. Can someone please help me how to write code and how to write it in C.
I've been working on a program and have hit a roadblock. I know conceptually what to do, but I'm having trouble implimenting it. Ok, so what it's suppose to do is take them randomly generated numbers that have been put in arrayints and factor them. This right now for an …
hi, there...ive come up with these codes and they work.but i dont know how to modify the program so that it prints sequence of asterisks in a single line based on the input gained using : 1.while 2.do-while 3.for please help... #include <stdio.h> int main() { int x; printf("Enter an …
is there a way to pass in numbers(int) like this? somename([0,0],[2,4],3); thanks for any help
Dear All, I am porting my C/C++ project (currently functioning on 32 bit machine) into 64 bit SUSUE linux machine uname -a Linux msglxd03 2.6.5-7.97-smp #1 SMP Fri Jul 2 14:21:59 UTC 2004 x86_64 x86_64 x86_64 GNU/Linux I am trying to get the warning Specific to long to int and …
i'm having error while compiling my code.. key_c_xor = userKeyArray[t]^C[i]; long long int key_c_xor[8]; int userKeyArray[4]; long long int C[36]; the error that i got was: error C2109: subscript requires array or pointer type anyone know how to fix it? thanks
Hi, The clock synchronization program below needs to be amended to add another clocksync.ini option to allow the progam to run just once and then terminate. Request you to please give your inputs for this. Thanks, Marconi. -------------------------------------------------------------------------------------- [code]#define WIN32_LEAN_AND_MEAN #define _WIN32_WINNT 0x0400 #include <windows.h> #include <winsock2.h> #include <stdio.h> #include …
Hi, Can you please help me what changes are required in an already existing Clock sycnchronization Program in C to add a txt.ini option in it which allows the progam to run just once and then terminate. Thanks. Marconi.
What memory model does Dev-Cpp follow...? And how can I change it to have a segment more than 64 KB of memory....? I need it as my program stops executing in between and throws an exception - "Process returned -1073741819c(0xC00000005)" Same thing happens in Code Blocks.... So i need to …
Hello! I was having trouble with this program i keep getting undeclared identifier errors for my seat array and my seatnumber variable. I was also wondering if i was going about writing this program the right way. Arrays are kinda new to me. This is the problem (Airline Reservatins System) …
# include “udf.h” /* definition variables LTIME =local time, SMER=standard meridian on which local time is based (in degrees), LMER= meridian of the observer (in degrees), N = nth day of the year*/ #define LTIME 12:00 #define SMER 116.25 #define LMER 123.44 #define N 173 DEFINE_PROFILE(heat_flux, t, i) { Real …
How do this Print the decimal, octal and hexadecimal values of all characters between the start and stop characters entered by a user. For example, if the user enters an a and z, the program should print all the characters between a and z and their respective numerical values. Make …
Hey Im already generating numbers correctly from 0 to MAX_INT. But Id like to know how can I change that range (including negetive numbers) And while already on the subject, why does this code only generate numbers in the VERY high 90s? [code] int main() { int array[100]; srand(time(0)); gen(array); …
I am new to C. I won't to understand how this program works. I found it and don't understand how to run it. When I do it says: Missing name for redirect. Here is the code. [CODE] #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { FILE *from, *to; …
hi i just want to know how to write a c program for heap sort. please help me
Hello everybody, i need a polygon formula to draw one. I want to make a function that will draw a polygon , depending on how many vertex's it has. I'm not good at math so i can't figure it out how to do it. Though, i do understand that it …
I couldn't help but notice that everytime I create a window or control with Win32, the text on the window looks jagged, as though it isn't being 'clear-typed' or something. Does anybody know how I can get the text to appear normal?
Hi I've recently started studying cURL and am having problem with the following code that i've written, [CODE]<?php include("LIB_parse.php"); # Include parse library include("LIB_http.php"); # Include cURL library $web_page = http_get($target="http://rapidshare-search-engine.com/index-s_submit=Search&sformval=1&s_type=0&what=1&s=billu&start=0.html", $referer="http://rapidshare-search-engine.com/"); $meta_tag_array = parse_array($web_page['FILE'], "href=", ">"); for($xx=0; $xx<count($meta_tag_array); $xx++) { $tag= return_between($meta_tag_array[$xx],"href=\"","\">",EXL)."\n"; ?> <a href=<?php echo $tag ?> >hh</a> …
Hi, i'm trying to include a c# dll in c code. i have created the tlb file , registered the dll but i couldn't load it. but i could load in c++. is there any way to achieve this or equivalent of below c++ code ? Thanks ******** C++ Code …
I have three strings: [CODE=C]char str1[] = "My name is John"; char str2 = "My name is John also"; char final [10];[/CODE] How would i go about comparing the first two strings, and put what is different (" also") into the third one?
The End.