15,540 Topics
| |
Looking at the First In First Out (FIFO) data situation. Just like a line at the grocery store check-out. Its counterpart FILO would be like a stack of dinner plates. | |
Hello, everyone! I have a program (a tcp server for text messages exchange), and i want it to do the following thing: if a port is already in use - choose automatically a new one (via rand() function) and inform me about that. I'm testing it on Solaras 5.9 if … | |
I write a C program that reads a text file and copies it to standard output, adding to the start of each line the line number and the number of characters in the line. For example, if file contained the following: Hello Daniweb forum How are you today? Good day … | |
Hi friends, can any one let me know what hash algorithm is used by linux system for its shadow passwords. I'm totally confused some say MD5 and some SHA-512 which one is true and can give the source for answer if got them. Thanks linux learner | |
Hello, I'm fairly new to C. But my question is simple. I am creating a program that will take in 4 characters from the keyboard(1 at a time). Then it will display these 4 char on one line but in order as they were inputted. (In one print function).What code … | |
I am having problems with my code it says that the value compare is not being intitalized please help. I need to enter seven words total then sort them out.please help. [CODE]// it might work2.cpp : Defines the entry point for the console application. // #include "stdafx.h" /* Inputs a … | |
Hi, Here's a part of the code: [CODE]#define S 1000 /* rows */ #define T 200 /* columns */ int main() { int n, i, j; float **x; x=(float**) malloc (T*sizeof(float*)); for(i=0; i<T; i++) x[i]=(float*) malloc (S*sizeof(float)); memset(x, 0, sizeof(x[0][0])*S*T); return 0; }[/CODE] This was compiled well (gcc) and had … | |
Hey guys. I'm having some issues with my Visual Studio 2008 Pro. I'm trying to compile the following code, included in the link [url]http://pastebin.com/r6WsG5r7;[/url] but, whenever I try compiling the code, I get like 5 erros: The errors are listed below. Why is it that moving certain declarations around changes … | |
Hello! Just wondering if someone might see what is wrong with this piece of code. I am trying to get the number of rows in resultsDaily so that my for loop may start at that number, so as to append the matrix. here are my header files: #include <iostream> #include … | |
please check this script [code]//program to add to 8 bit binory numbers(2) #include<iostream> using namespace std; int binory(int ,int *p); int addbinory(int *,int *, int *); //this is c++ program so if u want convert it c just change your cout to printf and cin to scanf and do nessassory … | |
Write a simple program to find the size of differenr basic data types in c. | |
Below is the code, when it run shows a combination of back-slash and forward slash and by putting them together and printing them shows a stick rotating. The problem is that it is only rotating at a same position I want to move it back and forth in a line. … | |
i want to write a program for reading mpeg-4 file headers to get info such as filetype ,encoder,bitrate,etc.. is there any library of these functions? i tried searching the forums but could find any desirable results ... i aint asking for the code.. jus a little help on which library … | |
In which path gcc resides in IBM AIX.Due to some change change in my .profile the path variable got changed now i am not able to get the path of gcc. please help me | |
I am attempting to put integers from a text file to an array. I am new to C. I have already found the number of lines and opened the file. I do not understand why this does not work: [CODE] for(i = 0; i <= numberlines; i++) { fscanf(f, "%d", … | |
Hello, I am still green to the C programming language. I am writing a multi-dimensional array program to store strings into an array. The program requires error checking to avoid overflow. I am using Visual Studio 2008. I am using a Windows O/S. The program runs fine on the first … | |
I want to create a function in which a text printed just shown for 1 sec then flush and then a new text appear.. basically the purpose is to create a loader...which appers when the data is manipulating..it will show like this. \|/.....when it moves fast ..it looks like a … | |
How do I write this code without the malloc function? [CODE]// 222.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #define N 6 #define MAX_STRLEN 80 void sort(char **a, int n); char *stringArray[N]; int main(int argc, char *argv[]) { int … | |
Hello everyone I am trying to learn about the compilation process. I am working on a pretty simple SDL game, but I know that making games isn't very practical, so I am using the project to learn about other programming aspects as well. One of the things I am trying … | |
I have encountered a problem with the following function when I use it. I do not know what is going on, and would like to ask for advise. The program compiles without any error, but when I execute it, it just freezes and exits. [CODE=c] typedef long long unsigned int … | |
Hi There. I am trying to use libCurl to copy the contents of a webpage into a string in C. This is what I have so far: [CODE]void Cmd_translate_f (char *message) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, va("http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=%s!&langpair=en|fr"),message); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); res = curl_easy_perform(curl); … | |
Can someone help me to make my function getbase2 to work? It needs to return a string value. [CODE]#include<stdio.h> char GetBase2(int iBase, int iNumber); int main() { int i; int number; printf("Enter number: "); scanf("%i", & number); printf("Enter base: "); scanf("%i", & i); printF("Conversion: %s\n",GetBase2(i,number)); } // Base 11 upwards … | |
1. What is the difference between the system and exec family of functions? 2. I want to collect the output of the call from the system functions say. Say I execute this system("date"); Now say I don't want it to display the output rather it give the output as an … | |
hello guys, the output of the program should be like this: [ICODE] With how many numbers do you love to work with? 3 Enter no 1: 23.4 Enter no 2: 15.54 Enter no3: 55.48 In ascending order the numbers are: 15.54 23.40 55.48 [/ICODE] I've written this program: [CODE] #include … | |
#include<stdio.h> void squeez(char s[],char z[]); int main() { char s[100] = "Hey wassup !!!!!!"; char z[100] = "Wow cool!!!!!"; squeez(s,z); return(0); } void squeez(char s[] , char z[]) { int j,dummy = 0,i=0; char x[100]; for(j = 0 ; s[j] != '\0';j++)/* the starting loop */ { while(z[i] != '\0') … | |
If say I have only the binary of a another source file (no original source is available), then how to create this with my own program. Like say I have a source file containing some function print_hello() Now I compile it and get the binary lib.o Now another program test_lib.c … | |
Hi. I am also having a standard deviation problem. When I try to calculate the sandard deviation of the numbers below with the suggested algorithm, I run into square root of a negative number. The algorithm does work for some data sets, but neither this one or 8 others. Does … | |
Here is the source code I came up with: #include <stdio.h> #define SPACE ' ' int main(void) { char c, prev; int space, newline; long other; space = 0; newline = 0; other = 0L; printf("Enter text to be analyzed (# to terminate):\n"); __fpurge(stdin); /* clears buffer */ while((c = … | |
number of iterations in the following loop [CODE]main() { int x=5, y=10, z=9 for (;x<=5;) {y++;z--; x=x+1/2; if(z==0) z=y;}}[/CODE] | |
hi all, i need help... ok, about the 2nd statement... [CODE] unsigned char buffer[BUFSIZ]; ... buffer[i] ^= argv[3][j++]; [/CODE] ok buffer contains characters from a file... so im a little confused about what that statement does... both the "^=" and the argv part... can anyone explain? thanks in advance... |
The End.