Programming :: Book Example Of Own Type Variable Initialization Wont Work?
Nov 8, 2010Its an example froom a book... and it does not work...
Code:
#include <stdio.h>
int main ( int argc, const char * argv[] ) {
[code]....
Its an example froom a book... and it does not work...
Code:
#include <stdio.h>
int main ( int argc, const char * argv[] ) {
[code]....
In C++ what does the suffix, "*" mean appended to a variable type, e.g., "char* variable1;"?
View 3 Replies View Relatedwhen i compile the device driver of led ,i get the erro like this:
[root@localhost led]# arm-linux-gcc -D__KERNEL__ -DMODULE -I /home/liumeng/lmldd
/linux-2.6.34.1/ -c -O -Wall led.c -o led.o
led.c:34: error: variable `GPIO_LED_ctl_ops' has initializer but incomplete type
[code]....
i have a minimal ubuntu desktop and i'm trying to install the latest nvidia driver (downloaded from their website) and i got the following error:
Quote:
/tmp/selfgz2431/NVIDIA-Linux-x86_64-256.53/kernel/nv.c: At top level:
/tmp/selfgz2431/NVIDIA-Linux-x86_64-256.53/kernel/nv.c:426:5: error: unknown field �ioctl� specified in initializer
/tmp/selfgz2431/NVIDIA-Linux-x86_64-256.53/kernel/nv.c:426:5: warning: initialization from incompatible pointer type
[code]....
i had to apt-get even gcc and make, so i'm probably missing some required package...
I am having a little trouble with a Bash shell script that I am working on. It is intended to read the information out of a gedcom genealogy file and determine who has lived in a particular area and output a report based upon who lived in a given area (like the different sections of a bygdebok for example). I am having a number of issues.
1) I can't seem to figure out how to get a variable to work as the index of an array. For example, I am trying to use the variable $individual to count which individual is being read in from the .ged file, and once that is figured out, next I will read in the individual's name, so I would like to create an array of names using the variable
Code:
$individual
as the index of the array. However, if I try the code
Code:
name[$individual]=$lineoftext;
[Code]....
I included only the last few lines of output as to not take up too much space because the output goes on forever, but you get the point from the example. This output has nothing to do with what the final output of the program is intended to be like. It is merely a test to prove that the 2 variables in question are getting their date loaded in properly.
I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.
i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't
foo=+12.40
bar=${foo#+}
how I can search within a variable and assign the results to a new variable. I'll use the following as an example -
cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`
with the echo command I get the following output assigned to list -
A
C
C
What I'd like to get for output is -
Audi
Cadillac
Chevy
how I could do this regardless of upper/lower case letters?
I am going to write a function which will do different operation base on the data type of the input parameter.
I am using C (Pure C, not C++).
The problem is that I do not know how to get the data type of the input parameter in C Language.
Can anyone tell me how to do this.
I'm trying to compile a program and it gives me the following:
I checked cmath-util.h:46 and cmath-util.h:48:
I'm not a C person, and the author is unavailable so far.
If I want to use that result to be saved in a variable, which type would it be in script? For clearing: let variable x and destination path is y/z
in prog.sh:
x=du -hb /y/z
echo $x
Q1: What type of x?
Q2: What option instead of -hb to presedent the size in kib?
I am learning network programming via a book of Richard Stevens.The sample source codes are given here
http://www.unpbook.com/unpv13e.tar.gz
I downloaded and unzipped the file in /usr/src folder.As per the instructions given in README of downloaded archive I did.
included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?
View 8 Replies View RelatedSo I installed the Unison synch software with sudo apt-get install unison-gtk. When I set up the two directories for synchronization it looks like this: $ unison ssh:\SERVER\pathpath /var/www/path/path/path
I am getting this error in terminal Uncaught exception Gtk.Error("GtkMain.init: initialization failed ml_gtk_init: initialization failed") Fatal error: exception Util.Fatal("Error in getLogch: /home/path/.unison/unison.log: No such file or directory"
What book you recommend to learn programming in C ANSI ?
View 1 Replies View RelatedThis loop is part of a bash script which takes multiple arguments.
Code:
for ((i=1;i<=$number;++i)) ; do
offset=$(($i+5))
[code]...
im currently using fedora 14 kde and i cant find a working comic book reader, i currently have the comic "the last man" and all the files are in .cbr, if someone could help me with this it would be greatly appreicated, i have tried installing mulitple comic book readers, so mabye a lil step by stepalso while i am posting, i currently use yumex to download all of my apps and stuff but some are out of date is there any way to update all the databases to recieve the most up to date apps?
View 6 Replies View RelatedI am not new to PC programming. I have been able to write C++ console programs. They are not too hard to write.Now, I want to move up to the Linux C++ Graphical User Interface (GUI) programming.Can an experienced member of the Linux community recommend a good reference book for programming the GUI windows?
View 14 Replies View RelatedDear Linux/c++/g++ programmers: the run result on my system, ubuntuLinux10.04(kernel2.6.35-25), gcc4.5.2 is not what book predict
source code
http://examples.oreilly.com/9780596007614/
11-28
11-29
11-24
#include "matrix.hpp"
[Code]...
I'm looking for javascript tutorials or books that meets the following criteria:
1. Very thorough: Starts with the most fundamental concepts and progresses logically from basic to advanced concepts, without skipping over important ideas for the sake of expediency.
2. Lots of small practice exercises that parallel the concepts and syntax being learned.
I've looked at a lot of tutorials, but they all tend to be lacking in one of these areas or the other.
A good book to learn about threads in C/C++?
View 3 Replies View RelatedI am trying to generic way to convert the string datatype to other primitive data type. To achieve, i used Template . But i getting error and couldn't resolve the issue and error reported is also clueless.
Code
====
#include <vector>
#include <iostream>
#include <string>
[Code].....
I am trying to do a search for the certain books, and I am trying to make it case insensitive. what I have come up with so far is this :
Code:
Database.txt
RETARDED MONKEY:RACHEAL ABRAHAML:30:30:20
GOLD:FATIN:23.20:12:3
StUPiD:JERLYN:20:40:3
Code:
echo -n "Title: "
read Title
echo -n "Author:"
read Author
echo ""
valuecheck='grep -i "$Title" Database.txt | grep -i "$Author" | awk -F":" '{ print $1}''
echo $valuecheck
if [ $Title = $valuecheck ] ; then
echo "HOHOHO"
else
echo "too bad"
fi
The issue which I am having is that, when it does the search for the correct row to be inputted into valuecheck, it will input the value as written in the database, which is in Uppercase. For this case, if I type in stupid for $Title and jerlyn for $Author, it searches the correct row, but the awk will print "STUPID" into the variable as that is what is written in the database. So how can I make my if statement case insensitive? Currently it reads like this:
Code:
if [ $Title = $valuecheck ] ; then
which means
if [stupid = StUPiD ] ; then
How can I make the if statement it case insensitive to allow it to display "HOHOHO"
Has any one ever come across a book on Linux programming which explains a Library structure in depth?
View 3 Replies View Relatedwith my "if" statement? It's probably just a bracket or something stupid missing, but I cant get the variable "type" to add the line when its selected:
clear
read -p "Please Enter Printer Name : " name
read -p "Please Enter Printer IP : " IP
read -p "Please Enter Printer Description : " des
read -p "Please Enter Printer Location : " loc
read -p "Please Enter Printer Class : " clas
[Code]...
I would like to unzip a simple PHP code files, to have a online PHP contact / phone book. Simply, slow, and not database oriented over complicated setups into settings. I have a PHP / web provider (free), not apache. WITHOUT SQL (like before it may exists) something like this [URL]
View 14 Replies View Relatedi want to pass variable in mysql qyery in c programming
View 1 Replies View RelatedCan I mount a WD My Book World Edition NAS in Ubuntu 11 without extensive terminal work? The NAS has a static ip, it can be ping'd from Ubuntu, and my Windows machines access it just fine, no passwords required.I have not been able to find a way to make this work. Nothing against the terminal per se, it's just still a little too unfamiliar and I keep hitting error road blocks on this one.
View 4 Replies View RelatedI want try controls how many kernels should be put into the GRUB2 menu on my Ubuntu 9.10 but since GRUB2 the #HOWMANY variable doesn't work. I found this post on the LQ blog about the #HOWMANY variable. I follow these instructions but I have a problem when I execute the last command "update-grub" because my result is this :
Code:
/usr/sbon/grub-mkconfig: 228: GRUB_HOWMANY: not found
I verified my work but I don't understand why it's doesn't work.
I have beat this enough and don't get what should have been a very simple thing to do. I build a variable;
Code:
CLIST=java,lua,python,php,perl,ruby,tcl
CLIST will be used by another bash script but I need to replace the commas with a space. I
[code]...