15,551 Topics
| |
Hi everybody. I'm new in C and would like to know how to delete last elements in the array? lets say I have array arr = {1,2,3,4,5} and whant to delet last two elements. is it possible to do? | |
Hello all.... Sorry if this is extremely simple and stupid but I was taking a look at the Forgers32 manuals just to have a poke at the win32 api. I was able to get his first example working to pop up a basic window but for some reason the title … | |
Is it possible to create gui programming using C. If yes then please give Example source code. thankx in advanced. | |
Hi, I have a replace function which replaces all the occurences of the string into another file. But when I use the replace function multiple times... it replaces the string which was passed in the last call only and all the previous replacement does not happen. Below is the code … | |
Hi! I'm making a chess program, that need to move pieces on the chess board, get an input,check if the move is valid and print the output. The compiler finds some errors that i don't understand...I need some help with the pieces functions. Plz help me fix them!!! my attempts … | |
I have a file(myfile.txt) with the following lines, the records are semicolon delimited [I]Bon Jovi;Living + 2;EP;A+ Metal Maze;Aliotta Haynes Music;LP;B- Shore Brothers, The;Wipe my door, check;LP;C+ Bulman, Dane & Greg;Dane & Greg Bulman;LP;C- Calbert, Herb & The Mexico Brass;Rise;LP;A´[/I] . . . I want to write a c program … | |
Look my program read all lines from (plain.txt) and save temporary every read strings line by line into another text called(all.txt), i made the md5sum hash on each line separately of (all.txt) and saving this hashes on calculating.txt... then delete the all.txt and calculating.txt, creating a new copy of calculating … | |
Hi people I'm programming in C like a month. I just made this code yesterday, but I want the same result with a better code without using recursion for optimization, i think mine is sloppy. Also im using linux distribution... Any ideas to change this code in 1 or 2 … | |
Hi everybody. Im trying to make a C program [CODE] 1 #include<stdio.h> 2 #define SIZE 100 3 4 int getline(char line[], int lim); 5 6 int getline(char line[], int lim) { 7 int c,i; 8 9 10 for(i=0; i<lim-1 && (c=getchar()) !="\0"; ++i) 11 line[i] = c; 12 if(c=="\n") { … | |
I need to prompt the user to enter two strings and then create a third string with the first half of string1 and the second half of string2. I was able to put the first half of string1 into string3 but I cannot figure out how to put the second … | |
Type an algorithm to solve the following problem: You want to read the different ages of a group of people until an age of negative is entered. Based on the ages entered, you should count and print how many of the people are old (above 65), how many are middle-aged … | |
How to print the enabled MACROS in my project? I am using C. RTOS eCos. Also i am using the makefile. In the makefile i wanted to print the all the defined MACROS. | |
alright, well the code I have is a complete mess and there HAS to be a better way of doing it as well.... it's right here [CODE]#include <stdio.h> #include <stdlib.h> int toExit(int exit){ while(exit != 1 || exit !=2){ printf("\n\nPlease Choose:\n1) Exit\n2) Run program again\nYour choice: "); scanf("%d", &exit); printf("\n"); … | |
Hi, What would be the best way to extract an array of strings (only the first strings separated by a "," ) encapsulated within the curly braces ( { } )from within a file...? Eg: Test.txt *************************** This is also in the text file { abc def ghi , jkl … | |
Program wont run error says 1>c:\users\owner\documents\visual studio 2008\projects\ia\ia\jb bakery.c(16) : warning C4013: 'sleep' undefined; assuming extern returning int 1>Linking... 1>JB Bakery.obj : error LNK2019: unresolved external symbol _sleep referenced in function _welcome 1>C:\Users\Owner\Documents\Visual Studio 2008\Projects\IA\Debug\IA.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Users\Owner\Documents\Visual Studio 2008\Projects\IA\IA\Debug\BuildLog.htm" … | |
If I had a structure like this [CODE]typedef struct { char word[101]; int freq; char filename[100]; } WordArray;[/CODE] and declared this inside a method instead of it being a global variable(so its local) [CODE] WordArray words[10000];[/CODE] then how would I allocate memory to this? I've had this [CODE] for (i=0;i<10000;i++) … | |
Hello all, I am trying to understand the concept of pipe-ing input/output through a C program. I wrote this simple code: [CODE] #include <stdio.h> #include <stdlib.h> void in_read (int *foo) { read (0, foo, 1); } void in_write (int foo) { write (1, &foo, 1); } int main (int argc, … | |
Hi there, I'm not sure if this is impossible to achieve or not, but I have a C program that I created that is compiled with an a.out executable. Is there a way that I could have it start/run automatically after I log in? I have a Mac running on … | |
(C language) Hi.. Can anyone write a function to accept a character and display it 10 times?? Thanks in advance.. | |
Hello all, Basically I'm trying to code a program that makes use of recursion to reverse an input integer, e.g. 123 will result in a display of 321. I've coded the program this far, but it just displays the last digit only. Where have I gone wrong? I.e. Instead of … | |
I am wondering how to read a file in c... this requires some more background information before you give me something useless What I have so far: [CODE]#include <stdio.h> int main(void) { FILE *fpr,*fpw; char C; int I; fpr = fopen("cwM.dat","r"); fpw = fopen("echocwM.dat","w"); while (C != EOF) { fscanf(fpr,"%c",&C); … | |
I need helping trying to retrieve data held in a [CODE]std::list<boost::shared_ptr<boost::any>>[/CODE] I am working on a Singleton Controller class with a private [B]std::list[/B]. Client class(es) will be able to [B]Add/Remove/Edit[/B] concrete class objects to be used by the program through this Controller class. The reason for using [B]boost::shared_ptr[/B] is because … | |
in multidimensional array what is the row and coloumn size.for example in 2d array a[2][2] this has 2 rows and 2coloumns .but what does this have a[2][3][4]????please explain me with practical example | |
Greetings all. I need help to create a c program for computation of moving average. | |
Given an array A of length N, my task is to find the element which repeats in A maximum number of times as well as the corresponding count. In case of ties,I choose the smaller element first. Input First line of input contains an integer T, denoting the number of … | |
Hi folks, I did a program to find a number at a lower bound position and upper bound position. For example, this is my array values 1 1 2 3 5 5 5 5 7 8 9 10 if i search lower position for 5 , it will return 4 … | |
I post this thread in shell scripting too I want to search the user input in file (by lines) but not all then with this line search on another file ( with the specific line) and show to the user. Example: file1.txt ======= a aa aaa aab aac file2.txt (corresponding … | |
Hi There i am developing a little Game Center (console application) for school. The Tic Tac Toe (singelplayer and Multiplayer) is already done. Now i want to develop a snake. When i test the snake, i get a force close. When i use a debugger, i have a SIGSEGV Error. … | |
I am implementing a program where I want to store only certain part of the input string. for eg if the input string is 0123456789 I want to discard 4 AND 7 and store 01235689 Please my program requires an input string of 10000 characters so running time is very … | |
How do I rewrite eq->pt_tree[0][0]=2; to user pointer subscript? [CODE]#include <stdio.h> #include <stdlib.h> /////////////////////////////// struct eq_values{ int * pt_tree[2]; }; //////////////////////////////// void main (){ struct eq_values input, *eq; int i =2; eq = &input; while(i--){ eq->pt_tree[i] = (int *) malloc(3 * sizeof (int)); if (!eq->pt_tree[i]){ printf("No\n"); exit(0); } } eq->pt_tree[0][0]=2; … |
The End.