19,876 Topics

Member Avatar for
Member Avatar for aliyami90

Hi guys How do I search a file ".txt" which contains three lists side by side for a word , then print the line that the word I searched for is in? NOTE: -The lists are lists of names . it would be beter if you show how to do …

Member Avatar for Adak
0
86
Member Avatar for fishwater00

Hi Folks, I got some problems and need your help. In school, my codes are writeen under UNIX system (Solaris10/SUN), now I need to transfer those codes to Linux (Redhat5). But after I directly copy to Linux, it shows many errors and warnings. Does anyone know which codes I need …

Member Avatar for JOAT
0
102
Member Avatar for tam13

Hi Guys, So I have the functiom find_index_of_max and I need to use main as a driver to print the index of the the max value in the array. However, mine isn't functioning correctly. So, I was wondering if anyone can tell me what I need to do. Thanks! [code]#include …

Member Avatar for JOAT
0
132
Member Avatar for stanleyz

Hi everyone, I'm new to c-programming. I'm currently trying to write a program using function call but end up in a mess. Can anyone help me please? I've been trying this for a few days. I wanted to write a program with "factorial" and "power" I'm refering to this example. …

Member Avatar for oieronle
0
277
Member Avatar for kubatur0

[code]#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> #include <string.h> typedef struct msgbuf { long mtype; FILE *mtext; } message_buf; main(){ int msqid; int msgflg = IPC_CREAT | 0666; key_t key; message_buf sbuf; size_t buf_length; key = 1234; if ((msqid = msgget(key, msgflg )) < 0){ perror("msgget"); exit(1); …

Member Avatar for oieronle
0
105
Member Avatar for Anex

I want to create a structure comprising of an integer and a pointer to it. However it doesnt seem to work and devC++ gives the following error [CODE]struct loha { int i; int *p = &i; ...7 } *pp; ...8[/CODE] Error : 7 I:\G\My CPP\structures.c [Warning] no semicolon at end …

Member Avatar for oieronle
0
137
Member Avatar for gcardonav

Hi guys: I got a program from a developer. My main problem is that the code is in C and I been trying to compile it, but it keeps me giving errors, well mainly warning, but some of them I am not sure what they mean and/or how to fix …

Member Avatar for gcardonav
0
147
Member Avatar for iqra123

hii how can we send messages periodically to client from server... in C i am running a client server program in C on linux.... in which my server has to ask some parameters (like system Up Time, no of processes ) from client.... i want this function to work periodically …

Member Avatar for iqra123
0
82
Member Avatar for rahulvig

c is a lanugage which is intresting and hard in comparsion of other.

Member Avatar for maceman
0
19
Member Avatar for neti1987

hi! I have a program, and I have 2 threads. in the first I lock a semaphore, and in the second I have to run some code, but only after the first locked the semaphore. right now I do it with busy-waiting: [CODE] void *thread_proxy_stub(void *arg) { int x; // …

Member Avatar for nbaztec
0
1K
Member Avatar for ZeRo 00

Hiieee...der I am writin a somethin where I require to get string from the user anr then tokenise it.Can some1 give me some ideas on how to get started.I need the string to be in a loop as well.

Member Avatar for ALi Nuces
0
97
Member Avatar for ritasha

Hello everyone, Am developing a C# window form application where it will listen to when someone clicks on a link(for example, "chat now") on the website(in PHP). I've seen various examples on socket programming but not what I really need. More details: - C# sharp application with a listener(listens to …

Member Avatar for ritasha
0
95
Member Avatar for karthi_selva

hi, int i=1; printf("%x",-1<<1); what is an output? how is it works? please any one explain it.

Member Avatar for karthi_selva
0
97
Member Avatar for Kartik_shashank

Hi! I just want to know, how can I open an image file using C in Console mode... Yes... I don't want it to open in MSPaint or anywhere like that. I want to open a 16-color bmp image with VGA Graphics Driver using C in console mode. Actually this …

Member Avatar for gowthamsettu
0
1K
Member Avatar for parisa_bala

Hi, I am developing a large scale code. In order to save the space, when I declare any pointer, I allocate it in another subroutine. Now it seems that it does not work when I use an array of pointers. I can summarize the code as: [CODE] #include "headers.h" /** …

Member Avatar for Banfa
0
174
Member Avatar for mukundyk

Hello everyone. The functions will be in the global scope right? So, returning a pointer from a function, where the pointer is a function pointer, must not be illegal right? Also, what address is held by the function pointer? Is it the first instruction's(in the function) address from the text …

Member Avatar for Banfa
0
143
Member Avatar for Alerwiali

If i have a 2D matrix of characters or integer or whatever!How do i check if another matrix is a sub-matrix of The 2D one ...Please!! help with simple code that work for any size of the matrices Thanks in advance to all .

Member Avatar for cupofdenial
-3
70
Member Avatar for btml

hi :) i managed to compile it but when i try it - it scream Segmentation-Fault. i have no idea where it happens exactly . only know that it happen :( can someone help me ? thanks in advance the program try to implement some kind of hash table : …

Member Avatar for Banfa
0
173
Member Avatar for fellixombc

Alright, my server only loops 3 times (recv's two strings that have been sent) and then freezes when there is no more information being recv'd. Note, this is happening in the listen() function. Main.cpp [CODE]/* * File: main.cpp * Author: fellixombc * * Created on May 23, 2010, 2:14 PM …

Member Avatar for fellixombc
0
1K
Member Avatar for omGac0W

Hi I'm REALLY new at C and am getting this "constant out of range in comparison error". The line with the error is this: [CODE]printf("Would you like you enter additional sets of data? (yes/no)"); scanf("%c", &answer); while( answer == 'yes'); <------ this line [/CODE] I haven't done character strings in …

Member Avatar for Banfa
0
1K
Member Avatar for kingnebula

Hello, I am trying to make a small utility that will search a process's memory for a specified value. I am currently able to both read and write memory values. But I'm not sure how I would go about scanning the memory for a value and getting it's base address. …

Member Avatar for kingnebula
0
210
Member Avatar for nshh

Hi, Please answer the below questions....thanks 1) How can I free the memory from main(). But the memory was allocated in function a(). void a() { char *b=malloc(10); } main() { a(); } 2) How can I return the local pointer variable? main() { char *a=result(); } char * result() …

Member Avatar for Radical Edward
0
133
Member Avatar for fpsasm

Hello, I am using strncpy to copy the first line of a multi-line buffer. I have successfully found the amount of characters to the end of the first line, and I have performed a strncpy to copy the first line of the buffer to a char *. However, some of …

Member Avatar for fpsasm
0
171
Member Avatar for ryan461

I've got this exercise from a book that wants me to program two rolling dice, add the value of the dice to together and basically track each time a number is rolled. So ive got an array with 11 spots for the numbers 2 - 12. Whats not working in …

Member Avatar for ryan461
0
112
Member Avatar for mick3339

I am trying to implement an expert system in C. I have written each rule in the expert system as a function. However, I want my system to be more flexible and can process these rules from an external file specified at run time rather than hard-coded. This will provide …

Member Avatar for gusano79
0
720
Member Avatar for tskellyfla

Hello again, YOu guys have been such a big help in helping me understand what I'm doing wrong in my programs I'm hoping that I can get help again. I am currently writing a code in C. I'm supposed to be writing a code that has the Fibonacci Series up …

Member Avatar for tesuji
0
106
Member Avatar for urbangeek

hi guys, can't understand why the answer of the following program is 7? Please explain.. [CODE]#include <stdio.h> #define SQ(x) x*x int main() { int a,b; a=5; b=-SQ(a+2); printf("%d",b); return 0; } [/CODE] thank you..

Member Avatar for urbangeek
0
163
Member Avatar for rohit83.ken
Member Avatar for Alfarata

I need to read in a csv file created by MSExcel into an array. The file contains 750 rows of 5 sets of numbers some int. some float. the format looks like this: 301,36,0.285,2.88,15.000 302,88,0.247,2.88,75.500 How do I read this data in a 'C' program without the commas, and then …

Member Avatar for sinju
0
153
Member Avatar for bruno386

Hi guys, I need to sort an array by date created. Please take a look at this code thus far [CODE] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace listboxarraysortexample { public partial class Form1 : Form { string[] …

Member Avatar for bruno386
0
2K
Member Avatar for Ferny84

I am stuck on this program that I am supposed to create. It has to ask the user for a text file where the format looks like: MATH 101 GEOLOGY 101 GYM 101 Then i'm supposed to store the information from the file in an array which then gets pointed …

Member Avatar for Ferny84
0
91
Member Avatar for johndoe444

I have say a loop. At the beginning of the loop I want to fill a very large array which is an array of structures. Is there way like memcpy to fill the array without going through for loop. I figure using memcpy instead of for loop would be a …

Member Avatar for johndoe444
0
171
Member Avatar for Fasola

First how do you use Dynamic and Static Memory Allocation? and why is supposed to be so popular in use?

Member Avatar for umair100
1
143
Member Avatar for atman

Hello, I have a a problem copying individual words inside 2D array. Array is dynamically created and initializes perfectly, but as soon as i call my function, and if i have 2 or more spaces between the words, its copying the spaces inside the next index element of the array. …

Member Avatar for Ancient Dragon
0
124
Member Avatar for mjoshi

I have a code which throws "segmentation fault" after some computation. I was looking for some help with efficient memory management. My program does the following: I have a grid with min. i,j,k coordinates -52, -34, -35 and max. i,j,k coordinates 53, 37, 33. (In i, j, k loop). I …

Member Avatar for arld101
0
136
Member Avatar for danarmstrong

I have a servlet written in Java and I am attempting to send data to the method using C and the WinSock2 API. When I attempt to just send the raw data I get an invalid stream header error. I am not sure how I should go about handling this …

Member Avatar for niyujin
0
83
Member Avatar for bobyx

Hello,everybody.Would you please describe me about the differences between the(|=) ,(^= ) operators?Is it possible to use(&=)instead of the above two assignments and how? Thanks,[code]Assignment,compound operators;[ |=,^= and &=][/code]

Member Avatar for bobyx
0
142
Member Avatar for Bluefox815

I was writing a program and wanted to write a struct that's used to match an input string and print a corresponding output. However, I ran into a very unexpected problem. This code gave me the compile error below. [code] #ifndef MATCH_H #define MATCH_H #define TOTAL_WORD_PAIRS 2 typedef struct { …

Member Avatar for Bluefox815
0
307
Member Avatar for cokaznsyco72

Does anyone know how to do file input and output with spreadsheets? Specifically I'm going to be using the open office spreadsheet. thanks

Member Avatar for cokaznsyco72
0
109
Member Avatar for eslmz

I use a non english keyboard and i'm writing a console program. When i want to check a non english character with using getch, it returns wrong ASCII values(it gives the same number for different characters). But when i try to use getchar, it returns the true ASCII numbers. But …

0
41
Member Avatar for tennis
Member Avatar for HappyTron

Hello Guys, I am trying to read lines from .xml file using a C program. Basically what program does is read the date, and if the current system date is in the range of the date range given, it fetches some data from the next lines in the date. However,my …

Member Avatar for Bluefox815
0
155
Member Avatar for mcodesmart

Hello, Please see the code below. it combines 2 strings into one. [code=c] #include<stdio.h> #include <string.h> int main() { char a[10], b[10], *p = NULL, *combine(char *s, char *t); strcpy(a, "horse"); strcpy(b, "fly"); p = combine(a,b); printf("%s\n",a); printf("%s\n",b); printf("%s",p); } char *combine(char *s, char *t) { int x,y; char r[50]; …

Member Avatar for Bluefox815
0
197
Member Avatar for icewolf

Hello. I'm trying to find out how to make it so only certain applications I have given authorisation to can use a C DLL I have created so that when I release it with a .Net application it cannot be used by others. I found out how to check what …

Member Avatar for Bluefox815
0
187
Member Avatar for Anex

I am facing some problems trying to understand the difference in handling strings when they are declared as a char array and when they are declared with a pointer pointing to them. In the following code snippets, I have a few doubts. 1.While code 1 works correctly, code 2 crashes …

Member Avatar for Ancient Dragon
0
116
Member Avatar for amen

how to check there exist number in string using isalpha.if number exist, display "only alphabetic,please input again" example : user input = i had to 2 number

Member Avatar for Ancient Dragon
0
156
Member Avatar for tomtetlaw

When I run my code, I get "Run-Time Check Failure #2 - Stack around the variable 'string' was corrupted." I have looked everywhere in my code for a source of this error, and I can't find one, I've also looked where a buffer overrun could occur. The variable string is …

Member Avatar for tomtetlaw
0
163
Member Avatar for starkman

Hello all! I am having a bit of a problem with the grasps of Open CV and thought i may be able to request some of your help. Though I'm not completely sure that this is the right category. I have been playing around with openCV to try and provide …

Member Avatar for megamanexp
0
235
Member Avatar for j-green.10

I just created a code in c++ and i was wondering if there is any way a can convert that into a excel document.

Member Avatar for iamthwee
0
79
Member Avatar for FierceLeming

Alright, the issue I'm having is figuring out whether or not I'm causing memory leaks. I'm considering three situations which might or might not be the same: 1) If I declare a variable in a block of code as a character array, I'm making a pointer to it. But when …

Member Avatar for Radical Edward
0
144

The End.