15,551 Topics

Member Avatar for
Member Avatar for marirs07
Member Avatar for marirs07
0
88
Member Avatar for dinwal

I have a project that I am working on. This is basically an extension of that. There is this weird error (Seg fault) when I run this code. What makes this error weird is that I print the value stored in the pointer and in the next line I pass …

Member Avatar for dinwal
0
102
Member Avatar for srisan
Member Avatar for Narue
0
55
Member Avatar for revenge2

Hello there, I have a set of variables that need to be overwritten onto a certain [U]row[/U] on an multidimensional array (char array[100][80]; ) of [U]strings[/U]. the variables are [U]integers[/U] and they need to be in the form [I]00:00:00,000 --> 00:00:00,000[/I] I don't know how overwrite the existing row and …

Member Avatar for Narue
0
103
Member Avatar for adraganov

Hi, guys. I've been reading your forum for some time. Now I need a little help again. I am trying to read a bitmap file using BITMAPFILEHEADER, BITMAPINFOHEADER and RGBQUAD in windows.h - I need RGB values or only one of them. All the info in header structures is OK. …

Member Avatar for adraganov
0
264
Member Avatar for DimaYasny

Hi all, I'm helping my girl out with her hw, (/me not knowing C at all, but someone has to help, right?) I am supposed to read user input, and then try to execute a given command plus the arguments in every given $PATH. I managed it all, but I …

Member Avatar for DimaYasny
1
295
Member Avatar for kgomes

I need to use an if/else statement like the following in another program of mine, but for some reason there is a problem with it. The statement seems to work for all values, except when I enter the N_MAX value of 0.1. It should be considered valid, but it's not. …

Member Avatar for Narue
0
95
Member Avatar for dark1806

hi i need a litle help.....i must write a program that search for a string in a text file and return the line in the text file were string was found...string its an argv....i wrote this code but it returns the whole text file when i search for something [CODE=c] …

Member Avatar for Narue
0
89
Member Avatar for iassael

how can i declare something like this? int main(int argc, char *argv[]){ char *users[] = {}; char *names[] = {}; openPasswd(users, names); return 0; } void openPasswd(char &users[] = {}, char &names[] = {}){ } as you see i want to populate the 2 char arrays from the function back …

Member Avatar for twomers
0
112
Member Avatar for ababhijit das
Member Avatar for shakunni

I know how to use the file_pointer=fopen("location","type") to open and check if a file exists. But I'm not sure how I would use this command or a similar one to check if a folder exists? What command do I have to use to check if a folder exists in the …

Member Avatar for Ancient Dragon
0
97
Member Avatar for dackle

How to create Floating Components for a Software ? I would like to create something like a Shooting Object and a Target, which is in itself a Desktop App. What kind of API should I use to create Objects which are Discrete parts of the same App unlike Windows... Thank …

Member Avatar for Ancient Dragon
0
31
Member Avatar for chescarleta18

[code] #include<stdio.h> int m,i,c; main() { clrscr(); for(m=1; m<=10; m++) { for(i=1; i<=10; i++) { c=m*i; printf ("%d\t",c); } printf ("\n"); } getch(); } [/code]

Member Avatar for chescarleta18
0
106
Member Avatar for raigs

N00B here. I need to reuse a function's return in other functions. The problem is that the function's return changes every time it is called. How to achieve this? [CODE]int FUNCTION1(void) { // do stuff return FUNCTIONRESULT; // return to be reused in other functions } int FUNCTION2(void) // <- …

Member Avatar for twomers
0
80
Member Avatar for hookah

Write a multi-module C program to manage an auto-parts database for a manufactory. help translate the bash script into c [code=script] #! /bin/sh #Project 2 CSC 3320 #echo menu test program stop=0 # reset loop termination flag. while test $stop -eq 0 # loop until done. do cat << ENDOFMENU …

Member Avatar for hookah
0
252
Member Avatar for omar isaid

Any one has an idea how to develop Header of GPRS tunneling protocol using C language or even has interest in something like that I am a professional C/C++ programmers living in jordan

Member Avatar for omar isaid
0
545
Member Avatar for seaders

So I've already got one function that takes a list of va_args, ..., and then formats it, like such [code=c] string form_string(string format, ...) { va_list args; va_start(args, format); ostringstream output(""); for (unsigned int i = 0; i < format.length(); i++) { if (format[i] == '%' && format[i+1] != '%' …

Member Avatar for seaders
0
927
Member Avatar for dark1806

i have to write C code for linux commands wich , apropos ,whereis(for a linux mini shell)..... if someone can tell me how to start...or help me with some links... which - shows the full path of (shell) commands --i need that comand to show me only the path of …

Member Avatar for Ancient Dragon
0
128
Member Avatar for myheart

can anyone help me doing my simple assignment,please. I feel fed up and got confused so far

Member Avatar for Seten
0
108
Member Avatar for sree2

bobsced0$ gcc -g -o prog ss.c bobsced0$ ./prog File size is:906984 Segmentation fault bobsced0$ gdb prog GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO …

Member Avatar for dkalita
0
234
Member Avatar for dark1806

hi..pls help me with this ...when i run this c program i get in result segmentation fault message (i run in ubuntu terminal): [CODE=c]#include<stdio.h> #include<utmp.h> int main() { char *s,*c; struct utmp *u; int i; c=getlogin(); setutent(); u=getutent(); while(u!=NULL) { if(u->ut_type==7 && strcmp(u->ut_user,c)==0) { printf("%-12s",u->ut_user); printf("%-9s",u->ut_line); s=ctime(&u->ut_time); for(i=4;i<16;i++) printf("%c",s[i]); printf("(%s",u->ut_host); …

Member Avatar for dark1806
0
130
Member Avatar for gianx80

Hi, I'm studying the basis of C, C++ and Assembly languages at my university (I have two exams about these subjects, for now) ... and I have a problem ^^. I wrote a program in C (not so optimized, this isn't our present goal for my professors) that recieves in …

Member Avatar for gianx80
0
131
Member Avatar for meghs007

1. command line program for match two string and also allow the character • * -- any number of character • ? – Single Character Ex.: I/p:- This is a string Th?s is *g O/p Both string are Same pls help me to solve this program in c

Member Avatar for Ancient Dragon
0
72
Member Avatar for raigs

I need to generate and reuse a 5 digit random number every time my program is executed. But the following generates random numbers every time the function is called. [CODE]#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include <time.h> int RANDOM(void) { int RANDOMNUMBER = 0; srand((unsigned int)time(NULL)); …

Member Avatar for Ancient Dragon
0
117
Member Avatar for fedya

Hello guys! I have an assignment in my data structure class and I want to ask following thing: I have txt file which is unordered (not sorted) say like this: red apple blue sky white car handsome boy hello world My program should read file into linked list and sort …

Member Avatar for dkalita
0
86
Member Avatar for Mattpd

My file contains: [CODE] Hook,Mark,In, , ,Tire,Matt,Out,01/01/2001,Mike [/CODE] My structure: [CODE] struct part { char name [NAME_LEN+1]; char owner [OWNER_LEN+1]; char status [STATUS_LEN+1]; char date [DATE_LEN+1]; char renter [RENTER_LEN+1]; } parts [MAX_PARTS], temp [1]; [/CODE] And the code: [CODE] FILE *fp; fp=fopen("parts.csv","r"); printf("%d", fp); //Added this for debugging char buf[100]; …

Member Avatar for Mattpd
0
389
Member Avatar for kat_stephens

I've started on an assignment and just can't get it right PLEASE help! The assignment is :Write a program that will do the following: 1.) Continuously prompt the user for words and store the words in a linked list. Do not use an array or in any way pre-allocate any …

0
103
Member Avatar for johndoe444

Hi, This is the code fragment: [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> int main() { int* bugs_bunny; bugs_bunny = (int*)malloc(3*sizeof(int)); memset(bugs_bunny, 5, 3*sizeof(int)); printf("bugs_bunny[0] %d\n",bugs_bunny[0]); bugs_bunny[0] = 17; printf("bugs_bunny[0] %d\n",bugs_bunny[0]); return (1); }[/CODE] The outcome is: [CODE]bugs_bunny[0] 84215045 bugs_bunny[0] 17 [/CODE] Why is the value printed for …

Member Avatar for dan63043
0
101
Member Avatar for natureG

Hello, I am having a problem. The task I have been given is to implement a queue using a linked list. One of the functions of the program is it accept input from the user and write this to a file. The program, thus far, accepts the information, but prints …

Member Avatar for meghana8818
0
881
Member Avatar for roverphoenix

This program was written and tested in unix/linux environment (in EMacs editor )with a GCC compiler.

Member Avatar for Ancient Dragon
2
245

The End.